Remove MessageHandler[AutoCleanup] dependency from StreamInterface.

This includes relying on related types such as MessageData and
PostEvent functionality inside the StreamInterface itself.

This affects mostly tests but OpenSSLStreamAdapter
requires special attention.

Bug: webrtc:11988
Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32290}
This commit is contained in:
Tomas Gunnarsson
2020-10-02 12:54:10 +02:00
committed by Commit Bot
parent b33a7186e6
commit eb79dd9ffd
9 changed files with 86 additions and 67 deletions

View File

@ -104,7 +104,7 @@ StreamResult FifoBuffer::Read(void* buffer,
// if we were full before, and now we're not, post an event
if (!was_writable && copy > 0) {
PostEvent(owner_, SE_WRITE, 0);
PostEvent(SE_WRITE, 0);
}
}
return result;
@ -129,7 +129,7 @@ StreamResult FifoBuffer::Write(const void* buffer,
// if we didn't have any data to read before, and now we do, post an event
if (!was_readable && copy > 0) {
PostEvent(owner_, SE_READ, 0);
PostEvent(SE_READ, 0);
}
}
return result;
@ -155,7 +155,7 @@ void FifoBuffer::ConsumeReadData(size_t size) {
read_position_ = (read_position_ + size) % buffer_length_;
data_length_ -= size;
if (!was_writable && size > 0) {
PostEvent(owner_, SE_WRITE, 0);
PostEvent(SE_WRITE, 0);
}
}
@ -185,7 +185,7 @@ void FifoBuffer::ConsumeWriteBuffer(size_t size) {
const bool was_readable = (data_length_ > 0);
data_length_ += size;
if (!was_readable && size > 0) {
PostEvent(owner_, SE_READ, 0);
PostEvent(SE_READ, 0);
}
}