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

Issue 1871953002: Fixes for SkRWBuffer (Closed)

Created:
4 years, 8 months ago by scroggo
Modified:
4 years, 8 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Fixes for SkRWBuffer Do not call SkBufferHead::validate in SkROBuffer's destructor, which may be called in a separate thread from SkRWBuffer::append. validate() reads SkBufferBlock::fUsed, and append() writes to it, resulting in a data race. Update some comments to be more clear about how it is safe to use these classes across threads. Test the readers in separate threads. In addition, make sure it is safe to create a reader even when no data has been appended. Add tests for this case. Mark a parameter to SkBufferHead::validate() as const, reflecting its use. BUG=chromium:601578 BUG=chromium:605479 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1871953002 Committed: https://skia.googlesource.com/skia/+/635164028594b4af0086ec85b5e4570dd11091da

Patch Set 1 #

Total comments: 7

Patch Set 2 : Replace long comment with function call #

Patch Set 3 : Rebase #

Patch Set 4 : Remove fTail changes #

Patch Set 5 : Capture arrays by reference #

Patch Set 6 : Attempt to avoid data race in SkBufferBlock->fNext #

Patch Set 7 : Capture only the stream/reader needed #

Patch Set 8 : Change ownership in test, plus remove test after SkRWBuffer deletion #

Patch Set 9 : Fix indentation #

Patch Set 10 : Restore original test (in addition to threaded one) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -16 lines) Patch
M include/core/SkRWBuffer.h View 1 2 3 4 5 1 chunk +8 lines, -5 lines 0 comments Download
M src/core/SkRWBuffer.cpp View 1 2 3 4 5 6 chunks +19 lines, -8 lines 0 comments Download
M tests/DataRefTest.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +53 lines, -3 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 29 (13 generated)
scroggo
reed@ - public API bungeman@ - avoid the data race, as we discussed mtklein@ - ...
4 years, 8 months ago (2016-04-08 16:15:29 UTC) #3
mtklein
https://codereview.chromium.org/1871953002/diff/1/tests/DataRefTest.cpp File tests/DataRefTest.cpp (right): https://codereview.chromium.org/1871953002/diff/1/tests/DataRefTest.cpp#newcode297 tests/DataRefTest.cpp:297: // Declaring this SkTaskGroup inside this block ensures that ...
4 years, 8 months ago (2016-04-08 17:13:49 UTC) #4
reed1
mike and I had a chat about this. lets talk more before proceeding with this ...
4 years, 8 months ago (2016-04-08 17:17:00 UTC) #5
scroggo
On 2016/04/08 17:17:00, reed1 wrote: > mike and I had a chat about this. lets ...
4 years, 8 months ago (2016-04-11 16:24:43 UTC) #7
mtklein
> I have a different issue. It is perfectly safe to run this test (and ...
4 years, 8 months ago (2016-04-11 17:05:49 UTC) #8
scroggo
On 2016/04/11 17:05:49, mtklein wrote: > > I have a different issue. It is perfectly ...
4 years, 8 months ago (2016-04-11 19:27:43 UTC) #9
reed1
lgtm
4 years, 8 months ago (2016-04-12 01:35:20 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1871953002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1871953002/60001
4 years, 8 months ago (2016-04-14 17:58:12 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/7917)
4 years, 8 months ago (2016-04-14 18:00:43 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1871953002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1871953002/80001
4 years, 8 months ago (2016-04-14 18:20:59 UTC) #17
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://skia.googlesource.com/skia/+/d06920a29fe11c68bde2b93948ec99f277bb8459
4 years, 8 months ago (2016-04-14 18:40:53 UTC) #19
bungeman-skia
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/1882853004/ by bungeman@google.com. ...
4 years, 8 months ago (2016-04-14 21:56:39 UTC) #20
scroggo
On 2016/04/14 21:56:39, bungeman1 wrote: > A revert of this CL (patchset #5 id:80001) has ...
4 years, 8 months ago (2016-04-18 19:23:24 UTC) #22
scroggo
On 2016/04/18 19:23:24, scroggo wrote: > On 2016/04/14 21:56:39, bungeman1 wrote: > > A revert ...
4 years, 8 months ago (2016-04-21 21:04:19 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1871953002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1871953002/180001
4 years, 8 months ago (2016-04-22 13:50:06 UTC) #27
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 13:59:05 UTC) #29
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://skia.googlesource.com/skia/+/635164028594b4af0086ec85b5e4570dd11091da

Powered by Google App Engine
This is Rietveld 408576698