2012-01-24 14:03:37 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-03 22:32:37 +03:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-01-24 14:03:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. 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__
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "js/RootingAPI.h"
|
2014-04-01 10:13:50 +04:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsWrapperCache.h"
|
2012-01-24 14:03:37 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
class nsPIDOMWindow;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace indexedDB {
|
2012-01-24 14:03:37 +04:00
|
|
|
|
2014-04-01 10:13:50 +04:00
|
|
|
class IDBWrapperCache : public DOMEventTargetHelper
|
2012-01-24 14:03:37 +04:00
|
|
|
{
|
2014-09-27 03:21:57 +04:00
|
|
|
JS::Heap<JSObject*> mScriptOwner;
|
|
|
|
|
2012-01-24 14:03:37 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-09-27 03:21:57 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(IDBWrapperCache,
|
|
|
|
DOMEventTargetHelper)
|
2012-01-24 14:03:37 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
JSObject*
|
|
|
|
GetScriptOwner() const
|
2012-01-24 14:03:37 +04:00
|
|
|
{
|
|
|
|
return mScriptOwner;
|
|
|
|
}
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
void
|
|
|
|
SetScriptOwner(JSObject* aScriptOwner);
|
|
|
|
|
|
|
|
void AssertIsRooted() const
|
2012-07-06 21:28:51 +04:00
|
|
|
#ifdef DEBUG
|
2014-09-27 03:21:57 +04:00
|
|
|
;
|
2012-07-06 21:28:51 +04:00
|
|
|
#else
|
2014-09-27 03:21:57 +04:00
|
|
|
{ }
|
2012-07-06 21:28:51 +04:00
|
|
|
#endif
|
|
|
|
|
2012-01-24 14:03:37 +04:00
|
|
|
protected:
|
2014-09-27 03:21:57 +04:00
|
|
|
explicit IDBWrapperCache(DOMEventTargetHelper* aOwner);
|
|
|
|
explicit IDBWrapperCache(nsPIDOMWindow* aOwner);
|
2012-01-24 14:03:37 +04:00
|
|
|
|
2012-02-27 20:52:19 +04:00
|
|
|
virtual ~IDBWrapperCache();
|
2012-01-24 14:03:37 +04:00
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2012-01-24 14:03:37 +04:00
|
|
|
|
|
|
|
#endif // mozilla_dom_indexeddb_idbwrappercache_h__
|