Currently content verification code is hard to follow. There are a few improvements I plan to do:
1. verified_contents.json is read from multiple places. Extract/refactor the logic of reading/creating verified_contents.json into one place. Do the same for computed_hashes.json
2. Failure is hard to track because of how content hash related classes (ContentHashReader/ContentHashFetcher/ContentVerifier) use them.
3. The lock in ContentHashFetcherJob is worrying, use weak pointers where necessary. This might also help us drop RefCountedThreadSafe from ContentHashFetcherJob.
4. Rip all repeating callbacks from the code as OnceCallbacks should be enough. Currently it's harder to do because of #3.
Currently content verification code is hard to follow. There are a few improvements I plan to do:
1. verified_contents.json is read from multiple places. Extract/refactor the logic of reading/creating verified_contents.json into one place. Do the same for computed_hashes.json
2. Failure is hard to track because of how content hash related classes (ContentHashReader/ContentHashFetcher/ContentVerifier) use them.
3. The lock in ContentHashFetcherJob is worrying, use weak pointers where necessary. This might also help us drop RefCountedThreadSafe from ContentHashFetcherJob.
4. Rip all repeating callbacks from the code as OnceCallbacks should be enough. Currently it's harder to do because of #3.
(edit test)
Comment 1 by bugdroid1@chromium.org
, Jan 19 2018