зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
21c9673687
Коммит
0e16f4fafd
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче