DescriptionExtended the ProtoDatabase to provide LoadKeys() functionality.
Before this change, the only way to scan all keys was to call LoadEntries() which loads the whole database. In our use case, this means copying a lot of image data which is wasteful.
With LoadKeys(), we still need to iterate the whole database but we don't have to copy out (and parse) the values -- just the keys. LoadKeys() is useful when storing relatively large values and only access to the keys is required.
We'll use LoadKeys() for NTP content suggestions to garbage collect data. We do that at times when we have a list of all still alive elements and need to intersect that with the elements stored in the db.
BUG=649009
Committed: https://crrev.com/108e9c223a70d6dc4604354ab5afb0b42b28d30f
Cr-Commit-Position: refs/heads/master@{#422772}
Patch Set 1 #Patch Set 2 : try to make MakeUnique happy #Patch Set 3 : try to make MakeUnique happy #Patch Set 4 : fixed message loop handling in test. #Patch Set 5 : minor cleanups #
Total comments: 3
Patch Set 6 : Avoid repeating long types via MakeUnique #Patch Set 7 : ScopedTempDir::path() --> ScopedTempDir::GetPath() #Patch Set 8 : ScopedTempDir::path() --> ScopedTempDir::GetPath() #Patch Set 9 : Garbage Collect orphaned images on service start-up. #Messages
Total messages: 33 (24 generated)
|