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

Issue 10454066: Move the core state machine of SSLClientSocketNSS into a thread-safe Core (Closed)

Created:
8 years, 6 months ago by Ryan Sleevi
Modified:
7 years, 3 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Move the core state machine of SSLClientSocketNSS into a thread-safe Core NSS SSL functions may block on the underlying PKCS#11 modules or on user input. On ChromeOS, which has a hardware TPM, calls may take upwards of several seconds, preventing any IPC due to the I/O thread being blocked. To avoid blocking the I/O thread on ChromeOS, move the core SSL implementation to a dedicated worker thread, so that only SSL sockets are blocked. BUG=122355 TEST=existing net_unittests + see bug. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=140697

Patch Set 1 #

Total comments: 63

Patch Set 2 : Fix thread-safety #

Total comments: 5

Patch Set 3 : Review feedback #

Total comments: 28

Patch Set 4 : Review feedback 2 #

Patch Set 5 : Rebase to ToT #

Patch Set 6 : Speculative remoting fixes #

Patch Set 7 : Speculative remoting fixes #

Patch Set 8 : Actually quit the loop #

Total comments: 5

Patch Set 9 : Cleanup #

Patch Set 10 : Fix win_rel by not caching the current threads task runner. See added comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3012 lines, -2019 lines) Patch
M net/socket/client_socket_factory.cc View 1 2 3 4 5 6 7 8 9 4 chunks +51 lines, -12 lines 0 comments Download
M net/socket/ssl_client_socket_nss.h View 1 2 5 chunks +32 lines, -134 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 3 8 chunks +2844 lines, -1847 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M net/third_party/nss/ssl/sslinfo.c View 1 2 3 chunks +11 lines, -0 lines 0 comments Download
M remoting/protocol/authenticator_test_base.cc View 1 2 3 4 5 6 7 8 3 chunks +40 lines, -11 lines 0 comments Download
M remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +32 lines, -12 lines 0 comments Download
M remoting/protocol/v2_authenticator_unittest.cc View 1 2 3 4 5 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
Ryan Sleevi
wtc: This is a rather large review, but should be largely functionally identical. Unfortunately, because ...
8 years, 6 months ago (2012-05-30 02:03:54 UTC) #1
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc#newcode42 net/socket/client_socket_factory.cc:42: #endif Design context: I debated very heavily on where ...
8 years, 6 months ago (2012-05-30 02:11:33 UTC) #2
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc#newcode102 net/socket/client_socket_factory.cc:102: nss_task_runner = nss_thread_->message_loop_proxy(); Further design context: Note that I'm ...
8 years, 6 months ago (2012-05-30 02:14:32 UTC) #3
wtc
Patch set 1 LGTM. Thanks for the excellent work. High-level comments: 1. In the CL's ...
8 years, 6 months ago (2012-05-30 22:54:28 UTC) #4
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc#newcode38 net/socket/client_socket_factory.cc:38: #if defined(OS_CHROMEOS) On 2012/05/30 22:54:29, wtc wrote: > > ...
8 years, 6 months ago (2012-05-30 23:20:09 UTC) #5
wtc
http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc#newcode38 net/socket/client_socket_factory.cc:38: #if defined(OS_CHROMEOS) If you plan to merge this CL ...
8 years, 6 months ago (2012-05-31 01:23:42 UTC) #6
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/1/net/socket/client_socket_factory.cc#newcode38 net/socket/client_socket_factory.cc:38: #if defined(OS_CHROMEOS) On 2012/05/31 01:23:42, wtc wrote: > > ...
8 years, 6 months ago (2012-05-31 01:31:14 UTC) #7
Ryan Sleevi
wtc: Some BUG fixes now that I've banged around with it for a bit, with ...
8 years, 6 months ago (2012-05-31 06:28:26 UTC) #8
Ryan Sleevi
will: I added you as a reviewer since I saw you recently posted on chromium-dev ...
8 years, 6 months ago (2012-05-31 06:30:21 UTC) #9
Ryan Sleevi
On 2012/05/31 06:30:21, Ryan Sleevi wrote: > will: I added you as a reviewer since ...
8 years, 6 months ago (2012-05-31 06:34:22 UTC) #10
Ryan Sleevi
wtc: PTAL at Patchset 3. You originally reviewed Patchset 1, so it might be easier ...
8 years, 6 months ago (2012-05-31 23:01:01 UTC) #11
wtc
Patch set 3 LGTM. http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c File net/third_party/nss/ssl/sslinfo.c (right): http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c#newcode379 net/third_party/nss/ssl/sslinfo.c:379: ssl_GetRecvBufLock(ss); On 2012/05/31 01:31:14, Ryan ...
8 years, 6 months ago (2012-06-01 01:02:38 UTC) #12
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/7004/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/7004/net/socket/client_socket_factory.cc#newcode51 net/socket/client_socket_factory.cc:51: nss_thread_->Start(); On 2012/06/01 01:02:38, wtc wrote: > > This ...
8 years, 6 months ago (2012-06-01 01:30:04 UTC) #13
willchan no longer on Chromium
Hm, looks like I had these draft comments leftover from last week. We chatted a ...
8 years, 6 months ago (2012-06-04 16:50:38 UTC) #14
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c File net/third_party/nss/ssl/sslinfo.c (right): http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c#newcode379 net/third_party/nss/ssl/sslinfo.c:379: ssl_GetRecvBufLock(ss); On 2012/06/01 01:02:38, wtc wrote: > > On ...
8 years, 6 months ago (2012-06-04 21:51:50 UTC) #15
willchan no longer on Chromium
http://codereview.chromium.org/10454066/diff/7004/net/socket/ssl_client_socket_nss.h File net/socket/ssl_client_socket_nss.h (right): http://codereview.chromium.org/10454066/diff/7004/net/socket/ssl_client_socket_nss.h#newcode155 net/socket/ssl_client_socket_nss.h:155: scoped_refptr<base::SingleThreadTaskRunner> nss_task_runner_; On 2012/06/04 21:51:51, Ryan Sleevi wrote: > ...
8 years, 6 months ago (2012-06-04 21:55:43 UTC) #16
wtc
http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c File net/third_party/nss/ssl/sslinfo.c (right): http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c#newcode379 net/third_party/nss/ssl/sslinfo.c:379: ssl_GetRecvBufLock(ss); I am not suggesting that we remove the ...
8 years, 6 months ago (2012-06-04 23:44:57 UTC) #17
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c File net/third_party/nss/ssl/sslinfo.c (right): http://codereview.chromium.org/10454066/diff/1/net/third_party/nss/ssl/sslinfo.c#newcode379 net/third_party/nss/ssl/sslinfo.c:379: ssl_GetRecvBufLock(ss); On 2012/06/04 23:44:58, wtc wrote: > > I ...
8 years, 6 months ago (2012-06-05 00:01:59 UTC) #18
Ryan Sleevi
+cc sergeyu for the remoting changes. With this change, the remoting/ FakeSocket attempts to push ...
8 years, 6 months ago (2012-06-05 02:04:01 UTC) #19
Sergey Ulanov
LGTM, but see my nits http://codereview.chromium.org/10454066/diff/20003/remoting/protocol/authenticator_test_base.cc File remoting/protocol/authenticator_test_base.cc (right): http://codereview.chromium.org/10454066/diff/20003/remoting/protocol/authenticator_test_base.cc#newcode30 remoting/protocol/authenticator_test_base.cc:30: class ChannelDoneHelper { In ...
8 years, 6 months ago (2012-06-05 04:29:46 UTC) #20
Ryan Sleevi
Thanks very much for the feedback Sergey. Rather than violate the design and force clean-up, ...
8 years, 6 months ago (2012-06-05 18:30:48 UTC) #21
Sergey Ulanov
LGTM On 2012/06/05 18:30:48, Ryan Sleevi wrote: > Thanks very much for the feedback Sergey. ...
8 years, 6 months ago (2012-06-05 19:22:04 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/10454066/38001
8 years, 6 months ago (2012-06-05 20:02:19 UTC) #23
commit-bot: I haz the power
Try job failure for 10454066-38001 (retry) on win_rel for step "content_unittests". It's a second try, ...
8 years, 6 months ago (2012-06-05 22:24:02 UTC) #24
Ryan Sleevi
http://codereview.chromium.org/10454066/diff/7004/net/socket/client_socket_factory.cc File net/socket/client_socket_factory.cc (right): http://codereview.chromium.org/10454066/diff/7004/net/socket/client_socket_factory.cc#newcode96 net/socket/client_socket_factory.cc:96: base::ThreadTaskRunnerHandle::Get()); On 2012/06/04 16:50:38, willchan wrote: > How about ...
8 years, 6 months ago (2012-06-06 00:57:06 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/10454066/40002
8 years, 6 months ago (2012-06-06 00:57:18 UTC) #26
commit-bot: I haz the power
8 years, 6 months ago (2012-06-06 02:17:07 UTC) #27
Change committed as 140697

Powered by Google App Engine
This is Rietveld 408576698