dom/bindings/AtomList.h
author Jim Mathies <jmathies@mozilla.com>
Wed, 12 Nov 2014 14:59:19 -0600
changeset 239674 dcc233b91a99e7d8cfaa39b508d2eb2c2496fab6
parent 158671 2faa6e031add81eea8ba514b6990403c45b65a17
child 345619 2fb342547aa8c02298f38714058411a651ea4b90
permissions -rw-r--r--
Bug 669200 - Various widget changes to support two new types of plugin widget. r=roc

/* -*- 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_AtomList_h
#define mozilla_dom_AtomList_h

#include "jsapi.h"
#include "mozilla/dom/GeneratedAtomList.h"

namespace mozilla {
namespace dom {

template<class T>
T* GetAtomCache(JSContext* aCx)
{
  JSRuntime* rt = JS_GetRuntime(aCx);

  auto atomCache = static_cast<PerThreadAtomCache*>(JS_GetRuntimePrivate(rt));

  return static_cast<T*>(atomCache);
}

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_AtomList_h