Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / indexedDB / IDBWrapperCache.h
blob129cc0b3129ad5bd1820f17063d2e333f6a1eb0f
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_indexeddb_idbwrappercache_h__
8 #define mozilla_dom_indexeddb_idbwrappercache_h__
10 #include "mozilla/DOMEventTargetHelper.h"
11 #include "mozilla/dom/indexedDB/IndexedDatabase.h"
13 BEGIN_INDEXEDDB_NAMESPACE
15 class IDBWrapperCache : public DOMEventTargetHelper
17 public:
18 NS_DECL_ISUPPORTS_INHERITED
19 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
20 IDBWrapperCache,
21 DOMEventTargetHelper)
23 JSObject* GetScriptOwner() const
25 return mScriptOwner;
27 void SetScriptOwner(JSObject* aScriptOwner);
29 #ifdef DEBUG
30 void AssertIsRooted() const;
31 #else
32 inline void AssertIsRooted() const
35 #endif
37 protected:
38 explicit IDBWrapperCache(DOMEventTargetHelper* aOwner)
39 : DOMEventTargetHelper(aOwner), mScriptOwner(nullptr)
40 { }
41 explicit IDBWrapperCache(nsPIDOMWindow* aOwner)
42 : DOMEventTargetHelper(aOwner), mScriptOwner(nullptr)
43 { }
45 virtual ~IDBWrapperCache();
47 private:
48 JS::Heap<JSObject*> mScriptOwner;
51 END_INDEXEDDB_NAMESPACE
53 #endif // mozilla_dom_indexeddb_idbwrappercache_h__