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

Issue 174963002: Finalize a throttled FileReader in stages. (Closed)

Created:
6 years, 10 months ago by sof
Modified:
6 years, 10 months ago
Reviewers:
haraken, michaeln, kinuko
CC:
blink-reviews, horo
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Finalize a throttled FileReader in stages. File read operations are throttled, a controller keeping track of a set of running readers, and those waiting for a turn. In the case of a running FileReader just completing its operation and an onload* event listener issuing a new read operation over the same reader, the throttling controller must correctly handle the renewal of that FileReader as a running (or now-pending) reader. This includes signalling that there's pending activity starting (and later on, completing) on the FileReader itself, something that wasn't correctly in this nested case. To address, a FileReader will now remove itself from its throttling controller in two stages: - once the readyState transitions from LOADING, the FileReader is removed as a running reader. - once the FileReader has dispatched all the required events, the FileReader itself signals that the pending activity has completed. In combination, this balances the reference counting on the underlying object. R=kinuko@chromium.org BUG=345608 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167706

Patch Set 1 #

Total comments: 5

Patch Set 2 : Rename added finalization class #

Patch Set 3 : Be explicit about performing 2nd finishing step #

Total comments: 4

Patch Set 4 : Rename FinishReader enum as FinishReaderType #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -10 lines) Patch
M Source/core/fileapi/FileReader.cpp View 1 2 3 6 chunks +28 lines, -10 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
haraken
kinuko-san: would you take a look?
6 years, 10 months ago (2014-02-21 10:01:34 UTC) #1
sof
Please have a look when you get the chance. Discovered while moving the File API ...
6 years, 10 months ago (2014-02-21 10:34:35 UTC) #2
kinuko
(+cc horo) Is it possible to add a test for this? https://codereview.chromium.org/174963002/diff/1/Source/core/fileapi/FileReader.cpp File Source/core/fileapi/FileReader.cpp (right): ...
6 years, 10 months ago (2014-02-21 15:25:48 UTC) #3
sof
I don't know how to test for a leak/failure to ref count correctly like this. ...
6 years, 10 months ago (2014-02-21 15:31:38 UTC) #4
kinuko
https://codereview.chromium.org/174963002/diff/1/Source/core/fileapi/FileReader.cpp File Source/core/fileapi/FileReader.cpp (right): https://codereview.chromium.org/174963002/diff/1/Source/core/fileapi/FileReader.cpp#newcode289 Source/core/fileapi/FileReader.cpp:289: throttlingController()->removeReader(this); On 2014/02/21 15:31:39, sof wrote: > On 2014/02/21 ...
6 years, 10 months ago (2014-02-21 15:43:10 UTC) #5
sof
On 2014/02/21 15:43:10, kinuko wrote: > https://codereview.chromium.org/174963002/diff/1/Source/core/fileapi/FileReader.cpp > File Source/core/fileapi/FileReader.cpp (right): > > https://codereview.chromium.org/174963002/diff/1/Source/core/fileapi/FileReader.cpp#newcode289 > ...
6 years, 10 months ago (2014-02-21 17:01:19 UTC) #6
sof
Switched to being explicit about performing this 2nd removal/finishing step instead.
6 years, 10 months ago (2014-02-21 17:15:53 UTC) #7
sof
On 2014/02/21 17:15:53, sof wrote: > Switched to being explicit about performing this 2nd removal/finishing ...
6 years, 10 months ago (2014-02-23 13:40:25 UTC) #8
kinuko
lgtm https://codereview.chromium.org/174963002/diff/140001/Source/core/fileapi/FileReader.cpp File Source/core/fileapi/FileReader.cpp (right): https://codereview.chromium.org/174963002/diff/140001/Source/core/fileapi/FileReader.cpp#newcode78 Source/core/fileapi/FileReader.cpp:78: enum FinishReader { DoNotRunPendingReaders, DoRunPendingReaders }; nit: can ...
6 years, 10 months ago (2014-02-24 02:24:21 UTC) #9
sof
https://codereview.chromium.org/174963002/diff/140001/Source/core/fileapi/FileReader.cpp File Source/core/fileapi/FileReader.cpp (right): https://codereview.chromium.org/174963002/diff/140001/Source/core/fileapi/FileReader.cpp#newcode78 Source/core/fileapi/FileReader.cpp:78: enum FinishReader { DoNotRunPendingReaders, DoRunPendingReaders }; On 2014/02/24 02:24:21, ...
6 years, 10 months ago (2014-02-24 07:18:58 UTC) #10
sof
The CQ bit was checked by sigbjornf@opera.com
6 years, 10 months ago (2014-02-24 07:19:08 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/174963002/210001
6 years, 10 months ago (2014-02-24 07:19:13 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/174963002/210001
6 years, 10 months ago (2014-02-24 13:32:11 UTC) #13
commit-bot: I haz the power
6 years, 10 months ago (2014-02-24 22:16:19 UTC) #14
Message was sent while issue was closed.
Change committed as 167706

Powered by Google App Engine
This is Rietveld 408576698