Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: mojo/services/media/common/cpp/fifo_allocator.cc

Issue 2081753002: Motown: Stop requiring size when releasing payload buffers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/media/common/cpp/fifo_allocator.cc
diff --git a/mojo/services/media/common/cpp/fifo_allocator.cc b/mojo/services/media/common/cpp/fifo_allocator.cc
index 0823b4495fb7890ae4189c99f97bb6a1b7e84e93..b92b4e1d943a0a8e8cb88cf925f6922c9f2abae7 100644
--- a/mojo/services/media/common/cpp/fifo_allocator.cc
+++ b/mojo/services/media/common/cpp/fifo_allocator.cc
@@ -67,22 +67,20 @@ uint64_t FifoAllocator::AllocateRegion(uint64_t size) {
return allocated->offset;
}
-void FifoAllocator::ReleaseRegion(uint64_t size, uint64_t offset) {
+void FifoAllocator::ReleaseRegion(uint64_t offset) {
// Start at active_->next. That's usually the region we're looking for.
- bool released = Release(size, offset, active_->next, nullptr) ||
- Release(size, offset, front_, active_);
+ bool released = Release(offset, active_->next, nullptr) ||
+ Release(offset, front_, active_);
MOJO_DCHECK(released);
}
-bool FifoAllocator::Release(uint64_t size,
- uint64_t offset,
+bool FifoAllocator::Release(uint64_t offset,
Region* begin,
Region* end) {
MOJO_DCHECK(begin != nullptr || end == nullptr);
for (Region* region = begin; region != end; region = region->next) {
if (region->offset == offset) {
MOJO_DCHECK(region->allocated);
- MOJO_DCHECK(region->size == size);
region->allocated = false;
Region* prev = region->prev;
« no previous file with comments | « mojo/services/media/common/cpp/fifo_allocator.h ('k') | mojo/services/media/common/cpp/shared_media_buffer_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698