| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool result = base::PathService::Get(chrome::DIR_USER_DATA, &path);Needs #include
scoped_refptr<update_client::CrxCache> GetCrxCache() const override;Needs decl?
crx_cache_ = base::MakeRefCounted<update_client::CrxCache>(#include
config->GetCrxCache()->RetainOnly(
config->GetUpdaterPersistedData()->GetAppIds(),
std::move(callback));Is this okay to do on the main sequence?
if (qualified) {Do we want to keep qualification app instances in the CRX cache? If qualification fails on the first attempt could the second attempt involve a differential update? I wonder if allowing it to be cached at all adds non-determinism to the qualification process.
// app IDs. O(N+M) time.Is the time complexity of the operation particularly important? It seems unusual to document, though I note it's also done above.
absl::flat_hash_set<std::string> retained_ids;
for (const auto& app_id : app_ids) {
retained_ids.insert(app_id);
}Consider using `absl::flat_hash_set`'s range constructor, e.g.
```
absl::flat_hash_set<std::string> retained_ids(app_ids.begin(), app_ids.end());
```
Alternatively, is the cost of linear search over the vector low enough to remove the set altogether? I can't imagine the cardinality of `app_ids` to be that great.
std::multimap<std::string, std::string> hashes_by_app_id =
ListHashesByAppId();nit: inline?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
config->GetCrxCache()->RetainOnly(
config->GetUpdaterPersistedData()->GetAppIds(),
std::move(callback));Is this okay to do on the main sequence?
I see now that the impl posts and the instance needs to be accessed on the main sequence.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool result = base::PathService::Get(chrome::DIR_USER_DATA, &path);Joshua PawlickiNeeds #include
Done (well, fixed the copypaste error)
scoped_refptr<update_client::CrxCache> GetCrxCache() const override;Joshua PawlickiNeeds decl?
Done
crx_cache_ = base::MakeRefCounted<update_client::CrxCache>(Joshua Pawlicki#include
Done
if (qualified) {Joshua PawlickiDo we want to keep qualification app instances in the CRX cache? If qualification fails on the first attempt could the second attempt involve a differential update? I wonder if allowing it to be cached at all adds non-determinism to the qualification process.
IIUC the trade-off is between the scenario that qualification "falsely" succeeds on the second attempt and the qualification reliably failing on further attempts. I think the former is rarer than the latter, and if the app reliably fails qualification post-download, I'd rather have it not stuck wasting user bandwidth by redownloading the same file.
Even if the former scenario occurs, that ultimately is a successful qualification, even if it took the updater multiple attempts.
Diff updates specifically shouldn't be an issue since we are caching the exact file we want to install (0 bytes differ).
// app IDs. O(N+M) time.Joshua PawlickiIs the time complexity of the operation particularly important? It seems unusual to document, though I note it's also done above.
I don't think so, but I wanted to be consistent with the above.
absl::flat_hash_set<std::string> retained_ids;
for (const auto& app_id : app_ids) {
retained_ids.insert(app_id);
}Consider using `absl::flat_hash_set`'s range constructor, e.g.
```
absl::flat_hash_set<std::string> retained_ids(app_ids.begin(), app_ids.end());
```Alternatively, is the cost of linear search over the vector low enough to remove the set altogether? I can't imagine the cardinality of `app_ids` to be that great.
range constructor, done. Good idea.
Cardinality: yeah, I had the same thought, but then realized app_ids can be 1000s in the case of extension updater, and if in that case we did have 1000s of items in cache, I decided the O(NM) is too much to pay.
std::multimap<std::string, std::string> hashes_by_app_id =
ListHashesByAppId();| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
LGTM, ty! Sorry, I did not realize that this change was still in my queue. Feel free to ping me if I'm slow on gerrit reviews, these have a nasty habit of falling out of my vision
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
LGTM, ty! Sorry, I did not realize that this change was still in my queue. Feel free to ping me if I'm slow on gerrit reviews, these have a nasty habit of falling out of my vision
No need to apologize, up until about 30 minutes ago there were still failing tests so I didn't feel a need to ping.
(...hopefully the tests are passing now.)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
ios/ LGTM
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ty Josh!
scoped to the UpdateEngine to being scoped to the configuator'stypo
void RetainOnly(const std::vector<std::string>& app_ids,RetainOnly(app_ids...) somehow suggests the opposite of what the function is documented to do. Maybe rename to `RemoveIfNot(app_id...)` or do `RemoveIf(pred...)` or `RetainIf(pred...`.
void RetainOnly(const std::vector<std::string>& app_ids,<vector>
virtual void RetainOnly(const std::vector<std::string>& app_ids) = 0;<vector>
for (const auto& pair : ListHashesByAppId()) {Can we destructure so we use something instead of `pair.first`?
cache->RemoveAll("appid", base::DoNothing());base/functional/callback_helpers.h
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
scoped to the UpdateEngine to being scoped to the configuator'sJoshua Pawlickitypo
Done
RetainOnly(app_ids...) somehow suggests the opposite of what the function is documented to do. Maybe rename to `RemoveIfNot(app_id...)` or do `RemoveIf(pred...)` or `RetainIf(pred...`.
Done
void RetainOnly(const std::vector<std::string>& app_ids,Joshua Pawlicki<vector>
Done
virtual void RetainOnly(const std::vector<std::string>& app_ids) = 0;Joshua Pawlicki<vector>
Done
Can we destructure so we use something instead of `pair.first`?
Done
cache->RemoveAll("appid", base::DoNothing());Joshua Pawlickibase/functional/callback_helpers.h
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Updater: Clear CrxCache entries belonging to unregistered apps.
Additionally, proactively clear the qualification app from the cache
after successful qualification.
These changes required expanding the lifetime of the CrxCache from being
scoped to the UpdateEngine to being scoped to the configurator's
lifetime.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |