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

Issue 2379113002: Extended the ProtoDatabase to provide LoadKeys() functionality. (Closed)

Created:
4 years, 2 months ago by tschumann
Modified:
4 years, 2 months ago
Reviewers:
nyquist
CC:
chromium-reviews, ntp-dev+reviews_chromium.org, Mathieu
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Extended 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -12 lines) Patch
M components/leveldb_proto/leveldb_database.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/leveldb_proto/leveldb_database.cc View 1 2 3 4 5 6 7 1 chunk +15 lines, -0 lines 0 comments Download
M components/leveldb_proto/proto_database.h View 2 chunks +7 lines, -0 lines 0 comments Download
M components/leveldb_proto/proto_database_impl.h View 1 2 3 4 5 4 chunks +35 lines, -1 line 0 comments Download
M components/leveldb_proto/proto_database_impl_unittest.cc View 1 2 3 4 5 6 7 2 chunks +51 lines, -0 lines 0 comments Download
M components/leveldb_proto/testing/fake_db.h View 7 chunks +37 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_database.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_database.cc View 1 2 3 4 5 6 7 8 1 chunk +26 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_database_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +45 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_service.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -3 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_service.cc View 1 2 3 4 5 6 7 8 5 chunks +11 lines, -5 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_service_unittest.cc View 1 2 3 4 5 6 7 8 8 chunks +86 lines, -3 lines 0 comments Download

Messages

Total messages: 33 (24 generated)
tschumann
4 years, 2 months ago (2016-09-30 11:09:15 UTC) #13
nyquist
lgtm. The CL description explains what this will be used for, but could you expand ...
4 years, 2 months ago (2016-10-03 21:46:42 UTC) #18
tschumann
https://codereview.chromium.org/2379113002/diff/80001/components/leveldb_proto/proto_database_impl.h File components/leveldb_proto/proto_database_impl.h (right): https://codereview.chromium.org/2379113002/diff/80001/components/leveldb_proto/proto_database_impl.h#newcode313 components/leveldb_proto/proto_database_impl.h:313: new std::vector<std::string>()); On 2016/10/03 21:46:42, nyquist (OOO after 10-6) ...
4 years, 2 months ago (2016-10-04 09:41:38 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379113002/100001
4 years, 2 months ago (2016-10-04 09:43:58 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/307970)
4 years, 2 months ago (2016-10-04 09:50:28 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379113002/140001
4 years, 2 months ago (2016-10-04 12:52:18 UTC) #28
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 2 months ago (2016-10-04 13:35:22 UTC) #30
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/108e9c223a70d6dc4604354ab5afb0b42b28d30f Cr-Commit-Position: refs/heads/master@{#422772}
4 years, 2 months ago (2016-10-04 13:37:26 UTC) #32
nyquist
4 years, 2 months ago (2016-10-04 14:22:46 UTC) #33
Message was sent while issue was closed.
That was a super helpful CL description! Thanks!

https://codereview.chromium.org/2379113002/diff/80001/components/leveldb_prot...
File components/leveldb_proto/proto_database_impl.h (right):

https://codereview.chromium.org/2379113002/diff/80001/components/leveldb_prot...
components/leveldb_proto/proto_database_impl.h:313: new
std::vector<std::string>());
On 2016/10/04 09:41:38, tschumann wrote:
> On 2016/10/03 21:46:42, nyquist (OOO after 10-6) wrote:
> > Nit: Can these not use MakeUnique?
> 
> Changed to not repeat the types anymore. I think it's cleaner now :-)

Agreed. I think this looks very clean.

Powered by Google App Engine
This is Rietveld 408576698