зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1028139 - DataBuffer should not be a refcounted class. r=jesup
This commit is contained in:
Родитель
8ba1728080
Коммит
b5ac94c24d
|
@ -15,16 +15,6 @@
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
class DataBuffer;
|
||||
|
||||
// Temporary whitelist for refcounted class dangerously exposing its destructor.
|
||||
// Filed bug 1028139 to address this class.
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<DataBuffer>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
class DataBuffer {
|
||||
public:
|
||||
DataBuffer() : data_(nullptr), len_(0) {}
|
||||
|
@ -43,8 +33,6 @@ class DataBuffer {
|
|||
size_t len() const { return len_; }
|
||||
const bool empty() const { return len_ != 0; }
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DataBuffer)
|
||||
|
||||
private:
|
||||
ScopedDeleteArray<uint8_t> data_;
|
||||
size_t len_;
|
||||
|
|
|
@ -168,7 +168,7 @@ class DtlsRecordParser {
|
|||
DtlsRecordParser(const unsigned char *data, size_t len)
|
||||
: buffer_(data, len), offset_(0) {}
|
||||
|
||||
bool NextRecord(uint8_t* ct, RefPtr<DataBuffer>* buffer) {
|
||||
bool NextRecord(uint8_t* ct, nsAutoPtr<DataBuffer>* buffer) {
|
||||
if (!remaining())
|
||||
return false;
|
||||
|
||||
|
@ -210,7 +210,7 @@ class DtlsRecordInspector : public Inspector {
|
|||
DtlsRecordParser parser(data, len);
|
||||
|
||||
uint8_t ct;
|
||||
RefPtr<DataBuffer> buf;
|
||||
nsAutoPtr<DataBuffer> buf;
|
||||
while(parser.NextRecord(&ct, &buf)) {
|
||||
OnRecord(layer, ct, buf->data(), buf->len());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче