AllocateContiguousHandleWithData( Buffer_ptr aDummyHandlePtr, const nsAReadableString& aDataSource )
AllocateContiguousHandleWithData( Buffer_ptr aDummyHandlePtr, const nsAString& aDataSource )
AllocateContiguousHandleWithData( Buffer_ptr aDummyHandlePtr, const nsAReadableString& aDataSource )  {    typedef const PRUnichar* PRUnichar_ptr;      // figure out the number of bytes needed the |HandleT| part, including padding to correctly align the data part    size_t handle_size    = NS_AlignedHandleSize(aDummyHandlePtr, PRUnichar_ptr(0));      // figure out how many |CharT|s wee need to fit in the data part    size_t string_length  = aDataSource.Length();      // how many bytes is that (including a zero-terminator so we can claim to be flat)?    size_t string_size    = (string_length+1) * sizeof(PRUnichar);    nsSharedBufferList::Buffer* result = 0;    void* handle_ptr = ::operator new(handle_size + string_size);    if ( handle_ptr )      {        typedef PRUnichar* PRUnichar_ptr;        PRUnichar* string_start_ptr = PRUnichar_ptr(NS_STATIC_CAST(unsigned char*, handle_ptr) + handle_size);        PRUnichar* string_end_ptr   = string_start_ptr + string_length;        nsReadingIterator<PRUnichar> fromBegin, fromEnd;        PRUnichar* toBegin = string_start_ptr;        copy_string(aDataSource.BeginReading(fromBegin), aDataSource.EndReading(fromEnd), toBegin);        result = new (handle_ptr) nsSharedBufferList::Buffer(string_start_ptr, string_end_ptr, string_start_ptr, string_end_ptr+1, PR_TRUE);      }    return result;  }