зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1112747 - Change mozilla::plugins::IPCByteRanges from std::vector to nsTArray. r=jimm
This commit is contained in:
Родитель
87e6fa3cd6
Коммит
013542ec0b
|
@ -171,7 +171,7 @@ BrowserStreamChild::NPN_RequestRead(NPByteRange* aRangeList)
|
|||
IPCByteRanges ranges;
|
||||
for (; aRangeList; aRangeList = aRangeList->next) {
|
||||
IPCByteRange br = {aRangeList->offset, aRangeList->length};
|
||||
ranges.push_back(br);
|
||||
ranges.AppendElement(br);
|
||||
}
|
||||
|
||||
NPError result;
|
||||
|
|
|
@ -58,16 +58,16 @@ BrowserStreamParent::AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
|||
if (!mStream)
|
||||
return false;
|
||||
|
||||
if (ranges.size() > INT32_MAX)
|
||||
if (ranges.Length() > INT32_MAX)
|
||||
return false;
|
||||
|
||||
nsAutoArrayPtr<NPByteRange> rp(new NPByteRange[ranges.size()]);
|
||||
for (uint32_t i = 0; i < ranges.size(); ++i) {
|
||||
nsAutoArrayPtr<NPByteRange> rp(new NPByteRange[ranges.Length()]);
|
||||
for (uint32_t i = 0; i < ranges.Length(); ++i) {
|
||||
rp[i].offset = ranges[i].offset;
|
||||
rp[i].length = ranges[i].length;
|
||||
rp[i].next = &rp[i + 1];
|
||||
}
|
||||
rp[ranges.size() - 1].next = nullptr;
|
||||
rp[ranges.Length() - 1].next = nullptr;
|
||||
|
||||
*result = mNPP->mNPNIface->requestread(mStream, rp);
|
||||
return true;
|
||||
|
|
|
@ -75,7 +75,7 @@ struct IPCByteRange
|
|||
uint32_t length;
|
||||
};
|
||||
|
||||
typedef std::vector<IPCByteRange> IPCByteRanges;
|
||||
typedef nsTArray<IPCByteRange> IPCByteRanges;
|
||||
|
||||
typedef nsCString Buffer;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче