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

Issue 1954393002: Initialize and reset V4LocalDBManager. Instantiate V4Stores. (Closed)

Created:
4 years, 7 months ago by vakh (use Gerrit instead)
Modified:
4 years, 7 months ago
CC:
chromium-reviews, grt+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@v4_01_db_realz
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Initialize and reset V4LocalDBManager. Instantiate V4Stores. A rough sketch of how this works is here: https://goto.google.com/pver4-LoadUpdateDatabase-doc BUG=543161 Committed: https://crrev.com/32b9468ab5177534cb155b2d222611a6bca16c98 Cr-Commit-Position: refs/heads/master@{#393719}

Patch Set 1 #

Patch Set 2 : Add v4_store.cc to gypi and update a comment #

Total comments: 6

Patch Set 3 : Remove locking. Use ownership and thread hopping to guarantee that no locks are needed to access re… #

Patch Set 4 : Use #if so that code is not unreachable #

Patch Set 5 : content/public/browser is a dependency of v4_database #

Patch Set 6 : base::Time->Time and use kSafeBrowsingV4LocalDatabaseManagerEnabled always #

Patch Set 7 : No need to reset last_response_time_ and add DCHECK #

Patch Set 8 : Minor: Remove unused variable #

Total comments: 37

Patch Set 9 : CR feedback #

Total comments: 6

Patch Set 10 : CR feedback: call NewDBReadyCallback on the same thread #

Patch Set 11 : v4_db declared outside if() #

Total comments: 10

Patch Set 12 : CR feedback #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+278 lines, -53 lines) Patch
M chrome/browser/safe_browsing/services_delegate_impl.cc View 1 2 3 4 5 1 chunk +6 lines, -2 lines 2 comments Download
M components/safe_browsing_db.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/safe_browsing_db/BUILD.gn View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M components/safe_browsing_db/v4_database.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +28 lines, -9 lines 0 comments Download
M components/safe_browsing_db/v4_database.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +65 lines, -10 lines 2 comments Download
M components/safe_browsing_db/v4_local_database_manager.h View 1 2 3 4 5 6 7 8 4 chunks +21 lines, -4 lines 0 comments Download
M components/safe_browsing_db/v4_local_database_manager.cc View 1 2 3 4 5 6 7 8 9 5 chunks +65 lines, -9 lines 2 comments Download
M components/safe_browsing_db/v4_store.h View 1 2 3 4 5 6 7 8 1 chunk +17 lines, -0 lines 0 comments Download
A components/safe_browsing_db/v4_store.cc View 1 1 chunk +19 lines, -0 lines 0 comments Download
M components/safe_browsing_db/v4_update_protocol_manager.h View 1 2 4 chunks +8 lines, -3 lines 0 comments Download
M components/safe_browsing_db/v4_update_protocol_manager.cc View 1 2 3 4 5 6 7 8 10 chunks +41 lines, -13 lines 0 comments Download
M components/safe_browsing_db/v4_update_protocol_manager_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 36 (5 generated)
vakh (use Gerrit instead)
shess@chromium.org: Please review changes in * nparker@chromium.org: Please review changes in *
4 years, 7 months ago (2016-05-07 02:13:57 UTC) #2
vakh (use Gerrit instead)
Add v4_store.cc to gypi and update a comment
4 years, 7 months ago (2016-05-09 18:12:59 UTC) #3
Scott Hess - ex-Googler
https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc#newcode21 components/safe_browsing_db/v4_local_database_manager.cc:21: } DCHECK() and closing brace should be undented 4 ...
4 years, 7 months ago (2016-05-09 19:40:39 UTC) #4
Scott Hess - ex-Googler
https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc#newcode237 components/safe_browsing_db/v4_local_database_manager.cc:237: closing_database_ = true; On 2016/05/09 19:40:39, Scott Hess wrote: ...
4 years, 7 months ago (2016-05-09 20:28:09 UTC) #5
vakh (use Gerrit instead)
https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc#newcode237 components/safe_browsing_db/v4_local_database_manager.cc:237: closing_database_ = true; Scott, you're right that some of ...
4 years, 7 months ago (2016-05-09 20:32:25 UTC) #6
vakh (use Gerrit instead)
https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/1954393002/diff/20001/components/safe_browsing_db/v4_local_database_manager.cc#newcode237 components/safe_browsing_db/v4_local_database_manager.cc:237: closing_database_ = true; On 2016/05/09 20:28:08, Scott Hess wrote: ...
4 years, 7 months ago (2016-05-09 20:34:30 UTC) #7
vakh (use Gerrit instead)
Remove locking. Use ownership and thread hopping to guarantee that no locks are needed to ...
4 years, 7 months ago (2016-05-11 01:45:06 UTC) #8
vakh (use Gerrit instead)
Use #if so that code is not unreachable
4 years, 7 months ago (2016-05-11 18:00:32 UTC) #10
vakh (use Gerrit instead)
content/public/browser is a dependency of v4_database
4 years, 7 months ago (2016-05-11 18:03:19 UTC) #11
vakh (use Gerrit instead)
base::Time->Time and use kSafeBrowsingV4LocalDatabaseManagerEnabled always
4 years, 7 months ago (2016-05-11 19:57:02 UTC) #12
vakh (use Gerrit instead)
Thanks for your previous review. Please take another look. Here's an early draft of how ...
4 years, 7 months ago (2016-05-11 20:01:27 UTC) #13
vakh (use Gerrit instead)
No need to reset last_response_time_ and add DCHECK
4 years, 7 months ago (2016-05-11 20:26:26 UTC) #14
vakh (use Gerrit instead)
Minor: Remove unused variable
4 years, 7 months ago (2016-05-11 20:43:49 UTC) #15
Scott Hess - ex-Googler
Hmm. About 50/50 actual concerns versus style nits. It's like a casino! https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc ...
4 years, 7 months ago (2016-05-11 22:23:57 UTC) #16
vakh (use Gerrit instead)
CR feedback
4 years, 7 months ago (2016-05-12 22:29:51 UTC) #17
vakh (use Gerrit instead)
Thanks for the review. PTAL. https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc#newcode39 components/safe_browsing_db/v4_database.cc:39: V4Database* v4_database = nullptr; ...
4 years, 7 months ago (2016-05-12 22:30:20 UTC) #18
Scott Hess - ex-Googler
https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc#newcode63 components/safe_browsing_db/v4_database.cc:63: callback.Run(v4_database); On 2016/05/12 22:30:20, vakh wrote: > On 2016/05/11 ...
4 years, 7 months ago (2016-05-12 23:18:00 UTC) #19
vakh (use Gerrit instead)
CR feedback: call NewDBReadyCallback on the same thread
4 years, 7 months ago (2016-05-13 00:02:38 UTC) #20
vakh (use Gerrit instead)
v4_db declared outside if()
4 years, 7 months ago (2016-05-13 00:07:32 UTC) #21
vakh (use Gerrit instead)
https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/1954393002/diff/140001/components/safe_browsing_db/v4_database.cc#newcode63 components/safe_browsing_db/v4_database.cc:63: callback.Run(v4_database); On 2016/05/12 23:18:00, Scott Hess wrote: > On ...
4 years, 7 months ago (2016-05-13 00:07:32 UTC) #22
Scott Hess - ex-Googler
The test-writing comment is just informational, though a few tests should be on your near-term ...
4 years, 7 months ago (2016-05-13 17:58:56 UTC) #23
vakh (use Gerrit instead)
https://codereview.chromium.org/1954393002/diff/200001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/1954393002/diff/200001/components/safe_browsing_db/v4_database.cc#newcode32 components/safe_browsing_db/v4_database.cc:32: // the NewDatabaseReadyCallback on the same thread as it ...
4 years, 7 months ago (2016-05-13 23:11:02 UTC) #24
vakh (use Gerrit instead)
CR feedback
4 years, 7 months ago (2016-05-13 23:11:06 UTC) #25
Scott Hess - ex-Googler
LGTM!
4 years, 7 months ago (2016-05-13 23:14:37 UTC) #26
Nathan Parker
lgtm https://codereview.chromium.org/1954393002/diff/220001/chrome/browser/safe_browsing/services_delegate_impl.cc File chrome/browser/safe_browsing/services_delegate_impl.cc (right): https://codereview.chromium.org/1954393002/diff/220001/chrome/browser/safe_browsing/services_delegate_impl.cc#newcode189 chrome/browser/safe_browsing/services_delegate_impl.cc:189: #ifndef NDEBUG Do you want to keep this? ...
4 years, 7 months ago (2016-05-14 00:43:41 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1954393002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1954393002/220001
4 years, 7 months ago (2016-05-14 01:06:12 UTC) #29
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 7 months ago (2016-05-14 01:10:08 UTC) #31
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/32b9468ab5177534cb155b2d222611a6bca16c98 Cr-Commit-Position: refs/heads/master@{#393719}
4 years, 7 months ago (2016-05-14 01:11:06 UTC) #33
Ken Rockot(use gerrit already)
A revert of this CL (patchset #12 id:220001) has been created in https://codereview.chromium.org/1983603002/ by rockot@chromium.org. ...
4 years, 7 months ago (2016-05-15 00:30:58 UTC) #34
vakh (use Gerrit instead)
On 2016/05/15 00:30:58, Ken Rockot wrote: > A revert of this CL (patchset #12 id:220001) ...
4 years, 7 months ago (2016-05-16 02:27:12 UTC) #35
vakh (use Gerrit instead)
4 years, 7 months ago (2016-05-16 22:04:12 UTC) #36
Message was sent while issue was closed.
nparker@ -- I'm going to address your comments in
https://codereview.chromium.org/1980173003

https://codereview.chromium.org/1954393002/diff/220001/chrome/browser/safe_br...
File chrome/browser/safe_browsing/services_delegate_impl.cc (right):

https://codereview.chromium.org/1954393002/diff/220001/chrome/browser/safe_br...
chrome/browser/safe_browsing/services_delegate_impl.cc:189: #ifndef NDEBUG
On 2016/05/14 00:43:41, Nathan Parker wrote:
> Do you want to keep this?

Yes, added a TODO until I figure out why it isn't showing in UMA.

https://codereview.chromium.org/1954393002/diff/220001/components/safe_browsi...
File components/safe_browsing_db/v4_database.cc (right):

https://codereview.chromium.org/1954393002/diff/220001/components/safe_browsi...
components/safe_browsing_db/v4_database.cc:84: V4Database::~V4Database() {}
On 2016/05/14 00:43:41, Nathan Parker wrote:
> Check that this is on the correct thread.

Done.

https://codereview.chromium.org/1954393002/diff/220001/components/safe_browsi...
File components/safe_browsing_db/v4_local_database_manager.cc (right):

https://codereview.chromium.org/1954393002/diff/220001/components/safe_browsi...
components/safe_browsing_db/v4_local_database_manager.cc:132: if (!enabled_) {
On 2016/05/14 00:43:41, Nathan Parker wrote:
> I assume that if v4_database_ == null, we'll queue requests.

Yes, will add that logic later.

Powered by Google App Engine
This is Rietveld 408576698