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