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

Issue 744183002: More explicit thread checking in SafeBrowsingDatabase. (Closed)

Created:
6 years, 1 month ago by gab
Modified:
6 years ago
Reviewers:
mattm
CC:
chromium-reviews, grt+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@a3_deadcode
Project:
chromium
Visibility:
Public.

Description

More explicit thread checking in SafeBrowsingDatabase. As part of trying to understand threading rules for SafeBrowsingDatabase I added these explicit checks which helps documenting the expected flow. Also replaced old checks with modern Chromium synchronization constructs and explicitly mark SafeBrowsingStoreFile non-thread-safe. These new checks helped catch issue 438754 and issue 442891. More robust thread safety coming in https://codereview.chromium.org/790703003/ BUG=438754, 440517, 338486 Committed: https://crrev.com/d330bbbc6523984e903baaa41ce208f4f72691c4 Cr-Commit-Position: refs/heads/master@{#308673}

Patch Set 1 : #

Total comments: 6

Patch Set 2 : added a long-missing lock and cleaned up API comments #

Patch Set 3 : rebase onto CL 781613002 #

Patch Set 4 : rebase on CL 790703003 #

Patch Set 5 : crbug.com/338486 forces thread-checks to be disabled in ~SafeBrowsingStoreFile() #

Total comments: 2

Patch Set 6 : Remove documentary thread-checks on thread-safe methods. #

Patch Set 7 : no need to fake IO thread in unit tests anymore #

Patch Set 8 : rebased off of 790703003 #

Patch Set 9 : extract race fix to CL#793663003 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -84 lines) Patch
M chrome/browser/safe_browsing/database_manager.cc View 31 chunks +40 lines, -30 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.h View 1 2 3 4 5 6 7 5 chunks +19 lines, -21 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.cc View 1 2 3 4 5 6 7 8 29 chunks +42 lines, -25 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database_unittest.cc View 1 2 3 4 5 6 2 chunks +0 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store_file.h View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store_file.cc View 1 2 3 4 13 chunks +35 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (14 generated)
gab
Matt, PTAL. Thanks! Gab
6 years ago (2014-12-03 21:29:43 UTC) #6
mattm
https://codereview.chromium.org/744183002/diff/60001/chrome/browser/safe_browsing/database_manager.cc File chrome/browser/safe_browsing/database_manager.cc (right): https://codereview.chromium.org/744183002/diff/60001/chrome/browser/safe_browsing/database_manager.cc#newcode326 chrome/browser/safe_browsing/database_manager.cc:326: // DCHECK_CURRENTLY_ON(BrowserThread::UI); SafeBrowsingDatabaseManager is refcounted, so this can't really ...
6 years ago (2014-12-03 22:57:09 UTC) #7
gab
Replies below along with a new patch set. PTAL, thanks! Gab https://codereview.chromium.org/744183002/diff/60001/chrome/browser/safe_browsing/database_manager.cc File chrome/browser/safe_browsing/database_manager.cc (right): ...
6 years ago (2014-12-04 19:57:27 UTC) #8
gab
Hey Matt, PTAL. I'm in the progress of coming up with a thread-safe design for ...
6 years ago (2014-12-09 21:18:16 UTC) #9
mattm
https://codereview.chromium.org/744183002/diff/160001/chrome/browser/safe_browsing/safe_browsing_database.cc File chrome/browser/safe_browsing/safe_browsing_database.cc (right): https://codereview.chromium.org/744183002/diff/160001/chrome/browser/safe_browsing/safe_browsing_database.cc#newcode669 chrome/browser/safe_browsing/safe_browsing_database.cc:669: DCHECK_CURRENTLY_ON(BrowserThread::IO); Think I still don't see the benefit of ...
6 years ago (2014-12-12 23:50:44 UTC) #11
gab
Removed undesired checks, PTAL. Thanks, Gab https://codereview.chromium.org/744183002/diff/160001/chrome/browser/safe_browsing/safe_browsing_database.cc File chrome/browser/safe_browsing/safe_browsing_database.cc (right): https://codereview.chromium.org/744183002/diff/160001/chrome/browser/safe_browsing/safe_browsing_database.cc#newcode669 chrome/browser/safe_browsing/safe_browsing_database.cc:669: DCHECK_CURRENTLY_ON(BrowserThread::IO); On 2014/12/12 ...
6 years ago (2014-12-15 22:05:37 UTC) #14
mattm
lgtm
6 years ago (2014-12-15 23:30:21 UTC) #15
gab
On 2014/12/15 23:30:21, mattm wrote: > lgtm Thanks, extracted one-line race condition fix to https://codereview.chromium.org/793663003/ ...
6 years ago (2014-12-16 20:54:09 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/744183002/300001
6 years ago (2014-12-16 20:56:50 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/744183002/300001
6 years ago (2014-12-16 21:01:55 UTC) #24
commit-bot: I haz the power
Committed patchset #9 (id:300001)
6 years ago (2014-12-16 21:50:25 UTC) #25
commit-bot: I haz the power
6 years ago (2014-12-16 21:51:20 UTC) #26
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/d330bbbc6523984e903baaa41ce208f4f72691c4
Cr-Commit-Position: refs/heads/master@{#308673}

Powered by Google App Engine
This is Rietveld 408576698