зеркало из https://github.com/mozilla/pjs.git
Fixing crash in NS_MsgStripRE() due to multiply-linked strings. b=189591, sr=dbaron, r=me
This commit is contained in:
Родитель
17a76d3d2c
Коммит
591ddcae04
|
@ -180,11 +180,6 @@ struct nsStringAllocatorTraits<PRUnichar>
|
|||
// end of string allocator stuff that needs to move
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @status FROZEN
|
||||
*/
|
||||
template <class CharT>
|
||||
class nsSharedBufferHandle
|
||||
: public nsBufferHandle<CharT>
|
||||
|
@ -192,7 +187,6 @@ class nsSharedBufferHandle
|
|||
public:
|
||||
typedef PRUint32 size_type;
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
kIsImmutable = 0x01000000, // if this is set, the buffer cannot be modified even if its refcount is 1
|
||||
|
|
|
@ -188,9 +188,9 @@ class NS_COM nsXPIDLString
|
|||
// overridden to make getter_Copies mechanism work
|
||||
virtual const char_type* get() const
|
||||
{
|
||||
return (mBuffer.get() != GetSharedEmptyBufferHandle())
|
||||
? mBuffer->DataStart()
|
||||
: 0;
|
||||
return (mBuffer->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL)
|
||||
? 0
|
||||
: mBuffer->DataStart();
|
||||
}
|
||||
|
||||
// deprecated, to be eliminated
|
||||
|
@ -300,9 +300,9 @@ class NS_COM nsXPIDLCString
|
|||
// overridden to make getter_Copies mechanism work
|
||||
virtual const char_type* get() const
|
||||
{
|
||||
return (mBuffer.get() != GetSharedEmptyBufferHandle())
|
||||
? mBuffer->DataStart()
|
||||
: 0;
|
||||
return (mBuffer->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL)
|
||||
? 0
|
||||
: mBuffer->DataStart();
|
||||
}
|
||||
|
||||
// deprecated, to be eliminated
|
||||
|
|
|
@ -156,6 +156,7 @@ nsXPIDLString::GetSharedEmptyBufferHandle()
|
|||
// race to set the refcount, in
|
||||
// which case we'll pull the
|
||||
// same trick in |Destroy|.
|
||||
sBufferHandle->SetImplementationFlags(sBufferHandle->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL);
|
||||
}
|
||||
return sBufferHandle;
|
||||
}
|
||||
|
@ -238,6 +239,7 @@ nsXPIDLCString::GetSharedEmptyBufferHandle()
|
|||
// race to set the refcount, in
|
||||
// which case we'll pull the
|
||||
// same trick in |Destroy|.
|
||||
sBufferHandle->SetImplementationFlags(sBufferHandle->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL);
|
||||
}
|
||||
return sBufferHandle;
|
||||
}
|
||||
|
|
|
@ -180,11 +180,6 @@ struct nsStringAllocatorTraits<PRUnichar>
|
|||
// end of string allocator stuff that needs to move
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @status FROZEN
|
||||
*/
|
||||
template <class CharT>
|
||||
class nsSharedBufferHandle
|
||||
: public nsBufferHandle<CharT>
|
||||
|
@ -192,7 +187,6 @@ class nsSharedBufferHandle
|
|||
public:
|
||||
typedef PRUint32 size_type;
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
kIsImmutable = 0x01000000, // if this is set, the buffer cannot be modified even if its refcount is 1
|
||||
|
|
|
@ -188,9 +188,9 @@ class NS_COM nsXPIDLString
|
|||
// overridden to make getter_Copies mechanism work
|
||||
virtual const char_type* get() const
|
||||
{
|
||||
return (mBuffer.get() != GetSharedEmptyBufferHandle())
|
||||
? mBuffer->DataStart()
|
||||
: 0;
|
||||
return (mBuffer->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL)
|
||||
? 0
|
||||
: mBuffer->DataStart();
|
||||
}
|
||||
|
||||
// deprecated, to be eliminated
|
||||
|
@ -300,9 +300,9 @@ class NS_COM nsXPIDLCString
|
|||
// overridden to make getter_Copies mechanism work
|
||||
virtual const char_type* get() const
|
||||
{
|
||||
return (mBuffer.get() != GetSharedEmptyBufferHandle())
|
||||
? mBuffer->DataStart()
|
||||
: 0;
|
||||
return (mBuffer->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL)
|
||||
? 0
|
||||
: mBuffer->DataStart();
|
||||
}
|
||||
|
||||
// deprecated, to be eliminated
|
||||
|
|
|
@ -156,6 +156,7 @@ nsXPIDLString::GetSharedEmptyBufferHandle()
|
|||
// race to set the refcount, in
|
||||
// which case we'll pull the
|
||||
// same trick in |Destroy|.
|
||||
sBufferHandle->SetImplementationFlags(sBufferHandle->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL);
|
||||
}
|
||||
return sBufferHandle;
|
||||
}
|
||||
|
@ -238,6 +239,7 @@ nsXPIDLCString::GetSharedEmptyBufferHandle()
|
|||
// race to set the refcount, in
|
||||
// which case we'll pull the
|
||||
// same trick in |Destroy|.
|
||||
sBufferHandle->SetImplementationFlags(sBufferHandle->GetImplementationFlags() & shared_buffer_handle_type::kIsNULL);
|
||||
}
|
||||
return sBufferHandle;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче