Make GetImplementationFlags more useful/extensible by changing the default implementation to return zero rather than returning the flags from the shared buffer handle, and add a constant for one expected future use. b=109571 r=jag sr=scc

This commit is contained in:
dbaron%fas.harvard.edu 2002-05-17 02:53:34 +00:00
Родитель 21c9673687
Коммит 0e16f4fafd
4 изменённых файлов: 36 добавлений и 24 удалений

Просмотреть файл

@ -114,8 +114,15 @@ class NS_COM nsAString
// nsAString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsAString() { } // ...yes, I expect to be sub-classed
enum {
kHasStackBuffer = 0x00000001 // Has and is using a buffer on
// the stack (that could be copied
// to the heap if
// GetSharedBufferHandle() is
// called).
};
virtual PRUint32 GetImplementationFlags() const;
virtual const buffer_handle_type* GetFlatBufferHandle() const;
virtual const buffer_handle_type* GetBufferHandle() const;
virtual const shared_buffer_handle_type* GetSharedBufferHandle() const;
@ -358,8 +365,15 @@ class NS_COM nsACString
// nsACString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsACString() { } // ...yes, I expect to be sub-classed
enum {
kHasStackBuffer = 0x00000001 // Has and is using a buffer on
// the stack (that could be copied
// to the heap if
// GetSharedBufferHandle() is
// called).
};
virtual PRUint32 GetImplementationFlags() const;
virtual const buffer_handle_type* GetFlatBufferHandle() const;
virtual const buffer_handle_type* GetBufferHandle() const;
virtual const shared_buffer_handle_type* GetSharedBufferHandle() const;

Просмотреть файл

@ -106,11 +106,7 @@ nsAString::GetBufferHandle() const
PRUint32
nsAString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const shared_buffer_handle_type* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
return 0;
}
@ -605,11 +601,7 @@ nsACString::GetBufferHandle() const
PRUint32
nsACString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const shared_buffer_handle_type* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
return 0;
}

Просмотреть файл

@ -114,8 +114,15 @@ class NS_COM nsAString
// nsAString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsAString() { } // ...yes, I expect to be sub-classed
enum {
kHasStackBuffer = 0x00000001 // Has and is using a buffer on
// the stack (that could be copied
// to the heap if
// GetSharedBufferHandle() is
// called).
};
virtual PRUint32 GetImplementationFlags() const;
virtual const buffer_handle_type* GetFlatBufferHandle() const;
virtual const buffer_handle_type* GetBufferHandle() const;
virtual const shared_buffer_handle_type* GetSharedBufferHandle() const;
@ -358,8 +365,15 @@ class NS_COM nsACString
// nsACString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsACString() { } // ...yes, I expect to be sub-classed
enum {
kHasStackBuffer = 0x00000001 // Has and is using a buffer on
// the stack (that could be copied
// to the heap if
// GetSharedBufferHandle() is
// called).
};
virtual PRUint32 GetImplementationFlags() const;
virtual const buffer_handle_type* GetFlatBufferHandle() const;
virtual const buffer_handle_type* GetBufferHandle() const;
virtual const shared_buffer_handle_type* GetSharedBufferHandle() const;

Просмотреть файл

@ -106,11 +106,7 @@ nsAString::GetBufferHandle() const
PRUint32
nsAString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const shared_buffer_handle_type* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
return 0;
}
@ -605,11 +601,7 @@ nsACString::GetBufferHandle() const
PRUint32
nsACString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const shared_buffer_handle_type* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
return 0;
}