From 8c35be257128c9f98123862203e44198a474f461 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 11 Aug 2020 11:52:58 -0700 Subject: [PATCH] Add virtual destructors to ByteStream* --- .../common/cpp/client_wrapper/byte_buffer_streams.h | 4 ++++ .../cpp/client_wrapper/include/flutter/byte_streams.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/shell/platform/common/cpp/client_wrapper/byte_buffer_streams.h b/shell/platform/common/cpp/client_wrapper/byte_buffer_streams.h index 86cdfc4551209..e054e00f2d04c 100644 --- a/shell/platform/common/cpp/client_wrapper/byte_buffer_streams.h +++ b/shell/platform/common/cpp/client_wrapper/byte_buffer_streams.h @@ -23,6 +23,8 @@ class ByteBufferStreamReader : public ByteStreamReader { explicit ByteBufferStreamReader(const uint8_t* bytes, size_t size) : bytes_(bytes), size_(size) {} + virtual ~ByteBufferStreamReader() = default; + // |ByteStreamReader| uint8_t ReadByte() override { if (location_ >= size_) { @@ -69,6 +71,8 @@ class ByteBufferStreamWriter : public ByteStreamWriter { assert(buffer); } + virtual ~ByteBufferStreamWriter() = default; + // |ByteStreamWriter| void WriteByte(uint8_t byte) { bytes_->push_back(byte); } diff --git a/shell/platform/common/cpp/client_wrapper/include/flutter/byte_streams.h b/shell/platform/common/cpp/client_wrapper/include/flutter/byte_streams.h index 11f9928cd027a..f5314c0b9b575 100644 --- a/shell/platform/common/cpp/client_wrapper/include/flutter/byte_streams.h +++ b/shell/platform/common/cpp/client_wrapper/include/flutter/byte_streams.h @@ -12,6 +12,9 @@ namespace flutter { // An interface for a class that reads from a byte stream. class ByteStreamReader { public: + explicit ByteStreamReader() = default; + virtual ~ByteStreamReader() = default; + // Reads and returns the next byte from the stream. virtual uint8_t ReadByte() = 0; @@ -48,6 +51,9 @@ class ByteStreamReader { // An interface for a class that writes to a byte stream. class ByteStreamWriter { public: + explicit ByteStreamWriter() = default; + virtual ~ByteStreamWriter() = default; + // Writes |byte| to the stream. virtual void WriteByte(uint8_t byte) = 0;