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

Issue 2603173002: Use TaskScheduler instead of WorkerPool in nss_cert_database.cc. (Closed)

Created:
3 years, 11 months ago by fdoray
Modified:
3 years, 10 months ago
Reviewers:
stevenjb, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, stevenjb+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org, xunjieli
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use TaskScheduler instead of WorkerPool in nss_cert_database.cc. Also, remove NSSCertDatabase::SetSlowTaskRunnerForTest(). This method was used to run slow NSSCertDatabase tasks synchronously in tests. This is no longer useful since tasks posted through the post_task.h API within the scope of a ScopedTaskScheduler run synchronously. The following traits are used to post tasks to TaskScheduler: Priority: Inherited (default) The priority is inherited from the calling context (i.e. TaskTraits are initialized with the priority of the current task). Shutdown behavior: CONTINUE_ON_SHUTDOWN Tasks posted with this mode which have not started executing before shutdown is initiated will never run. Tasks with this mode running at shutdown will be ignored (the worker will not be joined). Note: Tasks that were previously posted to base::WorkerPool should use this shutdown behavior because this is how base::WorkerPool handles all its tasks. May Block: Tasks posted with MayBlock() may block. This includes but is not limited to tasks that wait on synchronous file I/O operations: read or write a file from disk, interact with a pipe or a socket, rename or delete a file, enumerate files in a directory, etc. This trait isn't required for the mere use of locks. BUG=659191 Review-Url: https://codereview.chromium.org/2603173002 Cr-Commit-Position: refs/heads/master@{#448059} Committed: https://chromium.googlesource.com/chromium/src/+/982a31fe2c2dc31014dfaf373c6e5da6f094dcc4

Patch Set 1 #

Total comments: 13

Patch Set 2 : rebase #

Patch Set 3 : remove MessageLoopsForUI #

Patch Set 4 : self-review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -67 lines) Patch
M chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M chromeos/cert_loader_unittest.cc View 3 chunks +2 lines, -3 lines 0 comments Download
M chromeos/network/auto_connect_handler_unittest.cc View 1 2 3 4 chunks +1 line, -6 lines 0 comments Download
M chromeos/network/client_cert_resolver_unittest.cc View 1 3 chunks +1 line, -4 lines 0 comments Download
M chromeos/network/network_cert_migrator_unittest.cc View 3 chunks +2 lines, -2 lines 0 comments Download
M chromeos/network/network_connection_handler_unittest.cc View 1 2 3 chunks +2 lines, -3 lines 0 comments Download
M net/cert/nss_cert_database.h View 1 4 chunks +0 lines, -13 lines 0 comments Download
M net/cert/nss_cert_database.cc View 1 6 chunks +17 lines, -24 lines 0 comments Download
M net/cert/nss_cert_database_chromeos.cc View 2 chunks +7 lines, -5 lines 0 comments Download
M net/cert/nss_cert_database_chromeos_unittest.cc View 5 chunks +8 lines, -3 lines 0 comments Download
M net/cert/nss_cert_database_unittest.cc View 1 4 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 36 (22 generated)
fdoray
PTAL. WorkerPool is being deprecated in favor of TaskScheduler.
3 years, 11 months ago (2017-01-04 00:47:12 UTC) #7
xunjieli
+rsleevi (since I'm completely unfamiliar with this part of the code base.) Ryan, since you ...
3 years, 11 months ago (2017-01-04 15:34:29 UTC) #9
Ryan Sleevi
https://codereview.chromium.org/2603173002/diff/1/chromeos/cert_loader_unittest.cc File chromeos/cert_loader_unittest.cc (right): https://codereview.chromium.org/2603173002/diff/1/chromeos/cert_loader_unittest.cc#newcode146 chromeos/cert_loader_unittest.cc:146: base::test::ScopedTaskScheduler scoped_task_scheduler_; Why don't you need to bind this ...
3 years, 11 months ago (2017-01-27 00:51:59 UTC) #11
fdoray
PTAnL https://codereview.chromium.org/2603173002/diff/1/chromeos/cert_loader_unittest.cc File chromeos/cert_loader_unittest.cc (right): https://codereview.chromium.org/2603173002/diff/1/chromeos/cert_loader_unittest.cc#newcode146 chromeos/cert_loader_unittest.cc:146: base::test::ScopedTaskScheduler scoped_task_scheduler_; On 2017/01/27 00:51:58, Ryan Sleevi wrote: ...
3 years, 10 months ago (2017-02-02 17:56:32 UTC) #16
Ryan Sleevi
I'm still a little weird-ed out by code switching base::ThreadTaskRunnerHandle to base::MessageLoop, but it sounds ...
3 years, 10 months ago (2017-02-02 22:13:51 UTC) #17
fdoray
On 2017/02/02 22:13:51, Ryan Sleevi wrote: > I'm still a little weird-ed out by code ...
3 years, 10 months ago (2017-02-03 13:42:02 UTC) #18
fdoray
xiyuan@chromium.org: Please review changes in chromeos/ and chrome/browser/chromeos/*. Thanks!
3 years, 10 months ago (2017-02-03 13:53:06 UTC) #20
fdoray
stevenjb@chromium.org: Please review changes in chromeos/ and chrome/browser/chromeos/*. Thanks!
3 years, 10 months ago (2017-02-03 13:57:11 UTC) #22
stevenjb
https://codereview.chromium.org/2603173002/diff/1/chromeos/network/auto_connect_handler_unittest.cc File chromeos/network/auto_connect_handler_unittest.cc (right): https://codereview.chromium.org/2603173002/diff/1/chromeos/network/auto_connect_handler_unittest.cc#newcode133 chromeos/network/auto_connect_handler_unittest.cc:133: message_loop_.task_runner()); Can't we / shouldn't we be able to ...
3 years, 10 months ago (2017-02-03 18:01:04 UTC) #23
fdoray
stevenjb@: PTAnL https://codereview.chromium.org/2603173002/diff/1/chromeos/network/auto_connect_handler_unittest.cc File chromeos/network/auto_connect_handler_unittest.cc (right): https://codereview.chromium.org/2603173002/diff/1/chromeos/network/auto_connect_handler_unittest.cc#newcode133 chromeos/network/auto_connect_handler_unittest.cc:133: message_loop_.task_runner()); On 2017/02/03 18:01:04, stevenjb wrote: > ...
3 years, 10 months ago (2017-02-03 19:23:07 UTC) #26
stevenjb
lgtm https://codereview.chromium.org/2603173002/diff/1/chromeos/network/network_connection_handler_unittest.cc File chromeos/network/network_connection_handler_unittest.cc (right): https://codereview.chromium.org/2603173002/diff/1/chromeos/network/network_connection_handler_unittest.cc#newcode314 chromeos/network/network_connection_handler_unittest.cc:314: base::MessageLoopForUI message_loop_; On 2017/02/03 19:23:07, fdoray wrote: > ...
3 years, 10 months ago (2017-02-03 20:04:50 UTC) #29
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/2603173002/60001
3 years, 10 months ago (2017-02-03 20:15:11 UTC) #32
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/982a31fe2c2dc31014dfaf373c6e5da6f094dcc4
3 years, 10 months ago (2017-02-03 20:35:48 UTC) #35
fdoray
3 years, 9 months ago (2017-02-28 01:26:23 UTC) #36
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/2722733002/ by fdoray@chromium.org.

The reason for reverting is: Using TaskScheduler with NSS is not safe until
TaskScheduler supports dynamically growing its thread pool..

Powered by Google App Engine
This is Rietveld 408576698