2014-09-08 20:41:22 +04: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 15:12: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/. */
|
2004-11-25 02:21:14 +03:00
|
|
|
|
|
|
|
#ifndef nsHashPropertyBag_h___
|
|
|
|
#define nsHashPropertyBag_h___
|
|
|
|
|
2005-06-05 22:55:41 +04:00
|
|
|
#include "nsIVariant.h"
|
2005-03-22 21:16:53 +03:00
|
|
|
#include "nsIWritablePropertyBag.h"
|
|
|
|
#include "nsIWritablePropertyBag2.h"
|
2014-09-08 20:41:32 +04:00
|
|
|
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2004-11-25 02:21:14 +03:00
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
|
2014-09-08 20:41:22 +04:00
|
|
|
class nsHashPropertyBagBase
|
2014-07-09 19:15:21 +04:00
|
|
|
: public nsIWritablePropertyBag
|
|
|
|
, public nsIWritablePropertyBag2
|
2004-11-25 02:21:14 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-09-08 20:41:22 +04:00
|
|
|
nsHashPropertyBagBase() {}
|
2004-11-25 02:21:14 +03:00
|
|
|
|
2014-07-09 19:15:21 +04:00
|
|
|
NS_DECL_NSIPROPERTYBAG
|
|
|
|
NS_DECL_NSIPROPERTYBAG2
|
2004-11-25 02:21:14 +03:00
|
|
|
|
2014-07-09 19:15:21 +04:00
|
|
|
NS_DECL_NSIWRITABLEPROPERTYBAG
|
|
|
|
NS_DECL_NSIWRITABLEPROPERTYBAG2
|
2005-03-22 21:16:53 +03:00
|
|
|
|
2004-11-25 02:21:14 +03:00
|
|
|
protected:
|
2014-07-09 19:15:21 +04:00
|
|
|
// a hash table of string -> nsIVariant
|
|
|
|
nsInterfaceHashtable<nsStringHashKey, nsIVariant> mPropertyHash;
|
2014-09-08 20:41:22 +04:00
|
|
|
};
|
2014-07-01 02:11:53 +04:00
|
|
|
|
2014-09-08 20:41:22 +04:00
|
|
|
class nsHashPropertyBag : public nsHashPropertyBagBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsHashPropertyBag() {}
|
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
|
|
|
|
protected:
|
2014-07-09 19:15:21 +04:00
|
|
|
virtual ~nsHashPropertyBag() {}
|
2004-11-25 02:21:14 +03:00
|
|
|
};
|
|
|
|
|
2014-09-08 20:41:32 +04:00
|
|
|
/* A cycle collected nsHashPropertyBag for main-thread-only use. */
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsHashPropertyBagCC final : public nsHashPropertyBagBase
|
2014-09-08 20:41:32 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsHashPropertyBagCC() {}
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsHashPropertyBagCC,
|
|
|
|
nsIWritablePropertyBag)
|
|
|
|
protected:
|
|
|
|
virtual ~nsHashPropertyBagCC() {}
|
|
|
|
};
|
|
|
|
|
2004-11-25 02:21:14 +03:00
|
|
|
#endif /* nsHashPropertyBag_h___ */
|