-
- Downloads
Bug 1748719 - Make nsStringInputStream more flexible as to the backing data buffer, r=mccr8
This change aims to make the way that the nsStringInputStream owns the backing data buffer more flexible. This has a few impacts, including allowing arbitrarily large payload sizes on 64-bit platforms, not requiring as complex checks around borrowed string buffers or nsTArray data storage, and supporting custom data ownership schemes such as those used by blobs. The new system uses a separate refcounted object internally to provide the contiguous backing buffer, with the nsStringInputStream wrapping it and providing the `nsIInputStream` interface and cursor. This also avoids issues around the buffer being mutated during reads, as mutating the `nsIInputStream` no longer mutates the actual data storage object. Differential Revision: https://phabricator.services.mozilla.com/D135162
Showing
- dom/file/MemoryBlobImpl.cpp 4 additions, 75 deletionsdom/file/MemoryBlobImpl.cpp
- dom/file/MemoryBlobImpl.h 15 additions, 36 deletionsdom/file/MemoryBlobImpl.h
- xpcom/io/StreamBufferSource.h 58 additions, 0 deletionsxpcom/io/StreamBufferSource.h
- xpcom/io/moz.build 1 addition, 0 deletionsxpcom/io/moz.build
- xpcom/io/nsIStringStream.idl 13 additions, 0 deletionsxpcom/io/nsIStringStream.idl
- xpcom/io/nsStringStream.cpp 157 additions, 93 deletionsxpcom/io/nsStringStream.cpp
- xpcom/io/nsStringStream.h 10 additions, 0 deletionsxpcom/io/nsStringStream.h
Loading
Please register or sign in to comment