зеркало из https://github.com/mozilla/gecko-dev.git
Bug 931571, part 12 - Add nsDiscriminatedUnion::GetType(). r=froydnj
This is not quite enough to make the data members private because XPCVariant pokes around to do some JS array stuff.
This commit is contained in:
Родитель
4bdbcd2020
Коммит
0994e4e4ed
|
@ -274,7 +274,7 @@ bool XPCVariant::InitializeData(JSContext* cx)
|
|||
if (!str)
|
||||
return false;
|
||||
|
||||
MOZ_ASSERT(mData.mType == nsIDataType::VTYPE_EMPTY,
|
||||
MOZ_ASSERT(mData.GetType() == nsIDataType::VTYPE_EMPTY,
|
||||
"Why do we already have data?");
|
||||
|
||||
size_t length = JS_GetStringLength(str);
|
||||
|
@ -645,7 +645,7 @@ XPCVariant::VariantDataToJS(nsIVariant* variant,
|
|||
/* readonly attribute uint16_t dataType; */
|
||||
NS_IMETHODIMP XPCVariant::GetDataType(uint16_t* aDataType)
|
||||
{
|
||||
*aDataType = mData.mType;
|
||||
*aDataType = mData.GetType();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1733,7 +1733,7 @@ nsVariant::~nsVariant()
|
|||
NS_IMETHODIMP
|
||||
nsVariant::GetDataType(uint16_t* aDataType)
|
||||
{
|
||||
*aDataType = mData.mType;
|
||||
*aDataType = mData.GetType();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@ public:
|
|||
|
||||
void Cleanup();
|
||||
|
||||
uint16_t GetType() const { return mType; }
|
||||
|
||||
nsresult ConvertToInt8(uint8_t* aResult) const;
|
||||
nsresult ConvertToInt16(int16_t* aResult) const;
|
||||
nsresult ConvertToInt32(int32_t* aResult) const;
|
||||
|
|
Загрузка…
Ссылка в новой задаче