mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1259021 - Rename Vector::extractRawBuffer to extractOrCopyRawBuffer r=Waldo
This commit is contained in:
parent
812266f4e1
commit
d5b6a661f0
@ -1567,7 +1567,7 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest,
|
||||
|
||||
if (!aString.empty()) {
|
||||
aRequest->mScriptTextLength = aString.length();
|
||||
aRequest->mScriptTextBuf = aString.extractRawBuffer();
|
||||
aRequest->mScriptTextBuf = aString.extractOrCopyRawBuffer();
|
||||
}
|
||||
|
||||
// This assertion could fire errorously if we ran out of memory when
|
||||
|
@ -1236,7 +1236,7 @@ DecodeExportName(JSContext* cx, Decoder& d, CStringSet* dupSet)
|
||||
if (!fieldBytes.append(0))
|
||||
return nullptr;
|
||||
|
||||
UniqueChars fieldName((char*)fieldBytes.extractRawBuffer());
|
||||
UniqueChars fieldName((char*)fieldBytes.extractOrCopyRawBuffer());
|
||||
if (!fieldName)
|
||||
return nullptr;
|
||||
|
||||
|
@ -21,7 +21,7 @@ ExtractWellSized(ExclusiveContext* cx, Buffer& cb)
|
||||
size_t capacity = cb.capacity();
|
||||
size_t length = cb.length();
|
||||
|
||||
CharT* buf = cb.extractRawBuffer();
|
||||
CharT* buf = cb.extractOrCopyRawBuffer();
|
||||
if (!buf)
|
||||
return nullptr;
|
||||
|
||||
|
@ -742,7 +742,7 @@ bool
|
||||
SCOutput::extractBuffer(uint64_t** datap, size_t* sizep)
|
||||
{
|
||||
*sizep = buf.length() * sizeof(uint64_t);
|
||||
return (*datap = buf.extractRawBuffer()) != nullptr;
|
||||
return (*datap = buf.extractOrCopyRawBuffer()) != nullptr;
|
||||
}
|
||||
|
||||
} /* namespace js */
|
||||
|
@ -649,7 +649,7 @@ public:
|
||||
*
|
||||
* N.B. Although a T*, only the range [0, length()) is constructed.
|
||||
*/
|
||||
MOZ_WARN_UNUSED_RESULT T* extractRawBuffer();
|
||||
MOZ_WARN_UNUSED_RESULT T* extractOrCopyRawBuffer();
|
||||
|
||||
/**
|
||||
* Transfer ownership of an array of objects into the vector. The caller
|
||||
@ -1301,7 +1301,7 @@ Vector<T, N, AP>::popCopy()
|
||||
|
||||
template<typename T, size_t N, class AP>
|
||||
inline T*
|
||||
Vector<T, N, AP>::extractRawBuffer()
|
||||
Vector<T, N, AP>::extractOrCopyRawBuffer()
|
||||
{
|
||||
T* ret;
|
||||
if (usingInlineStorage()) {
|
||||
|
@ -94,7 +94,7 @@ nsIncrementalStreamLoader::OnStopRequest(nsIRequest* request, nsISupports *ctxt,
|
||||
// provide nsIIncrementalStreamLoader::request during call to OnStreamComplete
|
||||
mRequest = request;
|
||||
size_t length = mData.length();
|
||||
uint8_t* elems = mData.extractRawBuffer();
|
||||
uint8_t* elems = mData.extractOrCopyRawBuffer();
|
||||
nsresult rv = mObserver->OnStreamComplete(this, mContext, aStatus,
|
||||
length, elems);
|
||||
if (rv != NS_SUCCESS_ADOPTED_DATA) {
|
||||
@ -153,7 +153,7 @@ nsIncrementalStreamLoader::WriteSegmentFun(nsIInputStream *inStr,
|
||||
}
|
||||
size_t length = self->mData.length();
|
||||
uint32_t reportCount = length > UINT32_MAX ? UINT32_MAX : (uint32_t)length;
|
||||
uint8_t* elems = self->mData.extractRawBuffer();
|
||||
uint8_t* elems = self->mData.extractOrCopyRawBuffer();
|
||||
|
||||
rv = self->mObserver->OnIncrementalData(self, self->mContext,
|
||||
reportCount, elems, &consumedCount);
|
||||
|
@ -98,7 +98,7 @@ nsStreamLoader::OnStopRequest(nsIRequest* request, nsISupports *ctxt,
|
||||
// provide nsIStreamLoader::request during call to OnStreamComplete
|
||||
mRequest = request;
|
||||
size_t length = mData.length();
|
||||
uint8_t* elems = mData.extractRawBuffer();
|
||||
uint8_t* elems = mData.extractOrCopyRawBuffer();
|
||||
nsresult rv = mObserver->OnStreamComplete(this, mContext, aStatus,
|
||||
length, elems);
|
||||
if (rv != NS_SUCCESS_ADOPTED_DATA) {
|
||||
|
Loading…
Reference in New Issue
Block a user