2014-09-08 16:41:22 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00: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/. */
|
2004-11-24 23:21:14 +00:00
|
|
|
|
|
|
|
#ifndef nsHashPropertyBag_h___
|
|
|
|
#define nsHashPropertyBag_h___
|
|
|
|
|
2005-06-05 18:55:41 +00:00
|
|
|
#include "nsIVariant.h"
|
2005-03-22 18:16:53 +00:00
|
|
|
#include "nsIWritablePropertyBag.h"
|
|
|
|
#include "nsIWritablePropertyBag2.h"
|
2014-09-08 16:41:32 +00:00
|
|
|
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2004-11-24 23:21:14 +00:00
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
|
2014-09-08 16:41:22 +00:00
|
|
|
class nsHashPropertyBagBase
|
2014-07-09 15:15:21 +00:00
|
|
|
: public nsIWritablePropertyBag
|
|
|
|
, public nsIWritablePropertyBag2
|
2004-11-24 23:21:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-09-08 16:41:22 +00:00
|
|
|
nsHashPropertyBagBase() {}
|
2004-11-24 23:21:14 +00:00
|
|
|
|
2014-07-09 15:15:21 +00:00
|
|
|
NS_DECL_NSIPROPERTYBAG
|
|
|
|
NS_DECL_NSIPROPERTYBAG2
|
2004-11-24 23:21:14 +00:00
|
|
|
|
2014-07-09 15:15:21 +00:00
|
|
|
NS_DECL_NSIWRITABLEPROPERTYBAG
|
|
|
|
NS_DECL_NSIWRITABLEPROPERTYBAG2
|
2005-03-22 18:16:53 +00:00
|
|
|
|
2004-11-24 23:21:14 +00:00
|
|
|
protected:
|
2014-07-09 15:15:21 +00:00
|
|
|
// a hash table of string -> nsIVariant
|
|
|
|
nsInterfaceHashtable<nsStringHashKey, nsIVariant> mPropertyHash;
|
2014-09-08 16:41:22 +00:00
|
|
|
};
|
2014-06-30 22:11:53 +00:00
|
|
|
|
2014-09-08 16:41:22 +00:00
|
|
|
class nsHashPropertyBag : public nsHashPropertyBagBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsHashPropertyBag() {}
|
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
|
|
|
|
protected:
|
2014-07-09 15:15:21 +00:00
|
|
|
virtual ~nsHashPropertyBag() {}
|
2004-11-24 23:21:14 +00:00
|
|
|
};
|
|
|
|
|
2014-09-08 16:41:32 +00:00
|
|
|
/* A cycle collected nsHashPropertyBag for main-thread-only use. */
|
|
|
|
class nsHashPropertyBagCC MOZ_FINAL : public nsHashPropertyBagBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsHashPropertyBagCC() {}
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsHashPropertyBagCC,
|
|
|
|
nsIWritablePropertyBag)
|
|
|
|
protected:
|
|
|
|
virtual ~nsHashPropertyBagCC() {}
|
|
|
|
};
|
|
|
|
|
2004-11-24 23:21:14 +00:00
|
|
|
#endif /* nsHashPropertyBag_h___ */
|