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

Unified Diff: src/core/SkRWBuffer.cpp

Issue 1882853004: Revert of Fixes for SkRWBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « include/core/SkRWBuffer.h ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRWBuffer.cpp
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp
index bbf88ddfe304abccff809db917bda89715705c25..f0b565edf3f685360844dace2af2997de810b5ed 100644
--- a/src/core/SkRWBuffer.cpp
+++ b/src/core/SkRWBuffer.cpp
@@ -42,8 +42,6 @@
return amount;
}
- // Do not call in the reader thread, since the writer may be updating fUsed.
- // (The assertion is still true, but TSAN still may complain about its raciness.)
void validate() const {
#ifdef SK_DEBUG
SkASSERT(fCapacity > 0);
@@ -96,7 +94,7 @@
}
}
- void validate(size_t minUsed, const SkBufferBlock* tail = nullptr) const {
+ void validate(size_t minUsed, SkBufferBlock* tail = nullptr) const {
#ifdef SK_DEBUG
SkASSERT(fRefCnt > 0);
size_t totalUsed = 0;
@@ -134,6 +132,7 @@
SkROBuffer::~SkROBuffer() {
if (fHead) {
+ fHead->validate(fAvailable);
fHead->unref();
}
}
@@ -143,7 +142,7 @@
}
void SkROBuffer::Iter::reset(const SkROBuffer* buffer) {
- if (buffer && buffer->fHead) {
+ if (buffer) {
fBlock = &buffer->fHead->fBlock;
fRemaining = buffer->fAvailable;
} else {
« no previous file with comments | « include/core/SkRWBuffer.h ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698