forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up SingleLogFileLogSource::ContinueReadFile
SingleLogFileLogSource::ContinueReadFile is a mess. In particular, it has a lot of complex code to handle file rotation, but the code is unreliable. It's unreliable because it only picks up information in the before-rotation file if the class is created before the rotation, and because it can only handle a single rotation -- if the log file rotates twice between feedbacks, we'll get a very confusing snippet of super-old log entries. Given that, file_ should just be a local variable not a member variable. This would also improve thread safety (there's no promise that two calls to ReadFile couldn't happen at the same time). This should make the code much simpler and remove excess if statements. Bug: b/186687538 Change-Id: Ie9ede634ba2941c12e4e475255021ea5563c523c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2817963 Commit-Queue: Ian Barkley-Yeung <iby@chromium.org> Reviewed-by: Ian Barkley-Yeung <iby@chromium.org> Cr-Commit-Position: refs/heads/master@{#880492}
- Loading branch information
1 parent
81abe66
commit c31021a
Showing
3 changed files
with
35 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters