Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=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/. */
6 :
7 : #ifndef mozilla_dom_idbwrappercache_h__
8 : #define mozilla_dom_idbwrappercache_h__
9 :
10 : #include "js/RootingAPI.h"
11 : #include "mozilla/DOMEventTargetHelper.h"
12 : #include "nsCycleCollectionParticipant.h"
13 : #include "nsWrapperCache.h"
14 :
15 : class nsPIDOMWindowInnter;
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 : class IDBWrapperCache : public DOMEventTargetHelper
21 : {
22 : JS::Heap<JSObject*> mScriptOwner;
23 :
24 : public:
25 : NS_DECL_ISUPPORTS_INHERITED
26 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(IDBWrapperCache,
27 : DOMEventTargetHelper)
28 :
29 : JSObject*
30 0 : GetScriptOwner() const
31 : {
32 0 : return mScriptOwner;
33 : }
34 :
35 : void
36 : SetScriptOwner(JSObject* aScriptOwner);
37 :
38 : void AssertIsRooted() const
39 : #ifdef DEBUG
40 : ;
41 : #else
42 : { }
43 : #endif
44 :
45 : protected:
46 : explicit IDBWrapperCache(DOMEventTargetHelper* aOwner);
47 : explicit IDBWrapperCache(nsPIDOMWindowInner* aOwner);
48 :
49 : virtual ~IDBWrapperCache();
50 : };
51 :
52 : } // namespace dom
53 : } // namespace mozilla
54 :
55 : #endif // mozilla_dom_idbwrappercache_h__
|