зеркало из https://github.com/mozilla/gecko-dev.git
Bug 730340 - Don't use expando properties for storing data on places nodes. Remove expandos support from result nodes. r=mak.
This commit is contained in:
Родитель
7ba8f62ee7
Коммит
8f86773f20
|
@ -20,9 +20,6 @@
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
|
|
||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
#include "nsIClassInfo.h"
|
|
||||||
#include "nsIProgrammingLanguage.h"
|
|
||||||
#include "nsIXPCScriptable.h"
|
|
||||||
|
|
||||||
#define TO_ICONTAINER(_node) \
|
#define TO_ICONTAINER(_node) \
|
||||||
static_cast<nsINavHistoryContainerResultNode*>(_node)
|
static_cast<nsINavHistoryContainerResultNode*>(_node)
|
||||||
|
@ -72,111 +69,6 @@ inline PRInt32 CompareIntegers(PRUint32 a, PRUint32 b)
|
||||||
return a - b;
|
return a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
namespace places {
|
|
||||||
// Class-info and the scriptable helper are implemented in order to
|
|
||||||
// allow the JS frontend code to set expando properties on result nodes.
|
|
||||||
class ResultNodeClassInfo : public nsIClassInfo
|
|
||||||
, public nsIXPCScriptable
|
|
||||||
{
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSIXPCSCRIPTABLE
|
|
||||||
|
|
||||||
// TODO: Bug 517718.
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetInterfaces(PRUint32 *_count, nsIID ***_array)
|
|
||||||
{
|
|
||||||
*_count = 0;
|
|
||||||
*_array = nsnull;
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetHelperForLanguage(PRUint32 aLanguage, nsISupports **_helper)
|
|
||||||
{
|
|
||||||
if (aLanguage == nsIProgrammingLanguage::JAVASCRIPT) {
|
|
||||||
*_helper = static_cast<nsIXPCScriptable *>(this);
|
|
||||||
NS_ADDREF(*_helper);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
*_helper = nsnull;
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetContractID(char **_contractID)
|
|
||||||
{
|
|
||||||
*_contractID = nsnull;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetClassDescription(char **_desc)
|
|
||||||
{
|
|
||||||
*_desc = nsnull;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetClassID(nsCID **_id)
|
|
||||||
{
|
|
||||||
*_id = nsnull;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetImplementationLanguage(PRUint32 *_language)
|
|
||||||
{
|
|
||||||
*_language = nsIProgrammingLanguage::CPLUSPLUS;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetFlags(PRUint32 *_flags)
|
|
||||||
{
|
|
||||||
*_flags = 0;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
GetClassIDNoAlloc(nsCID *_cid)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_AVAILABLE;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* As a static implementation of classinfo, we violate XPCOM rules andjust
|
|
||||||
* pretend to use the refcount mechanism. See classinfo documentation at
|
|
||||||
* https://developer.mozilla.org/en/Using_nsIClassInfo
|
|
||||||
*/
|
|
||||||
NS_IMETHODIMP_(nsrefcnt) ResultNodeClassInfo::AddRef()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
NS_IMETHODIMP_(nsrefcnt) ResultNodeClassInfo::Release()
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMPL_QUERY_INTERFACE2(ResultNodeClassInfo, nsIClassInfo, nsIXPCScriptable)
|
|
||||||
|
|
||||||
#define XPC_MAP_CLASSNAME ResultNodeClassInfo
|
|
||||||
#define XPC_MAP_QUOTED_CLASSNAME "ResultNodeClassInfo"
|
|
||||||
#define XPC_MAP_FLAGS nsIXPCScriptable::USE_JSSTUB_FOR_ADDPROPERTY | \
|
|
||||||
nsIXPCScriptable::USE_JSSTUB_FOR_DELPROPERTY | \
|
|
||||||
nsIXPCScriptable::USE_JSSTUB_FOR_SETPROPERTY
|
|
||||||
|
|
||||||
// xpc_map_end contains implementation for nsIXPCScriptable, that used the
|
|
||||||
// constant define above
|
|
||||||
#include "xpc_map_end.h"
|
|
||||||
|
|
||||||
static ResultNodeClassInfo sResultNodeClassInfo;
|
|
||||||
} // namespace places
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
using namespace mozilla::places;
|
using namespace mozilla::places;
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsNavHistoryResultNode)
|
NS_IMPL_CYCLE_COLLECTION_CLASS(nsNavHistoryResultNode)
|
||||||
|
@ -191,9 +83,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsNavHistoryResultNode)
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsNavHistoryResultNode)
|
||||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsINavHistoryResultNode)
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsINavHistoryResultNode)
|
||||||
if (aIID.Equals(NS_GET_IID(nsIClassInfo)))
|
|
||||||
foundInterface = static_cast<nsIClassInfo *>(&mozilla::places::sResultNodeClassInfo);
|
|
||||||
else
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsINavHistoryResultNode)
|
NS_INTERFACE_MAP_ENTRY(nsINavHistoryResultNode)
|
||||||
NS_INTERFACE_MAP_END
|
NS_INTERFACE_MAP_END
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче