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

Issue 4049: Port SSLClientSocket to Linux (Closed)

Created:
12 years, 3 months ago by dank
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Port SSLClientSocket to Linux Passes tests (once you enable them by removing DISABLED_). Probably want to add a mock https server so we can leave those tests enabled when we check in. Had to add full duplex support to TCPClientSocket on Linux to avoid kludgy plumbing issues. Also had to add dummy implementation of X509Certificate::~X509Certificate to prevent link error. Rediffed to current trunk, addressed all review issues. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=3751

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1291 lines, -53 lines) Patch
M base/nss_init.cc View 10 11 12 13 14 2 chunks +13 lines, -0 lines 0 comments Download
M net/base/client_socket.h View 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +12 lines, -0 lines 0 comments Download
M net/base/client_socket_factory.cc View 8 9 10 11 12 13 14 2 chunks +4 lines, -0 lines 0 comments Download
A net/base/nss_memio.h View 6 7 8 9 10 11 12 13 1 chunk +86 lines, -0 lines 0 comments Download
A net/base/nss_memio.c View 6 7 8 9 10 11 12 13 1 chunk +547 lines, -0 lines 0 comments Download
A net/base/ssl_client_socket_nss.h View 1 chunk +104 lines, -0 lines 0 comments Download
A net/base/ssl_client_socket_nss.cc View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +395 lines, -0 lines 0 comments Download
M net/base/ssl_client_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M net/base/tcp_client_socket.h View 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +34 lines, -8 lines 0 comments Download
M net/base/tcp_client_socket_libevent.cc View 3 4 5 6 7 8 9 10 11 12 13 14 13 chunks +65 lines, -42 lines 0 comments Download
A net/base/x509_certificate_nss.cc View 1 chunk +21 lines, -0 lines 0 comments Download
M net/net_lib.scons View 14 4 chunks +4 lines, -3 lines 0 comments Download
M net/net_unittests.scons View 14 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
dank
I need to go over the code once or twice more to try to make ...
12 years, 2 months ago (2008-10-06 05:35:02 UTC) #1
darin (slow to review)
http://codereview.chromium.org/4049/diff/823/628 File net/base/ssl_client_socket.h (right): http://codereview.chromium.org/4049/diff/823/628#newcode38 Line 38: class SSLClientSocket : public ClientSocket { ClientSocketFactory means ...
12 years, 2 months ago (2008-10-06 06:18:22 UTC) #2
Dean McNamee
I realize the comments say you wrote in NSPR style on purpose, but that's sort ...
12 years, 2 months ago (2008-10-06 09:34:24 UTC) #3
dank
OK, I renamed memio.{h,c} to nss_memio.{h,c}, figured out how to hide memio_buffer_* behind four simpler-to-use ...
12 years, 2 months ago (2008-10-06 22:24:27 UTC) #4
wtc
I haven't reviewed nss_memio.{h,cc} and ssl_client_socket* yet. I'd like to send you these review comments ...
12 years, 2 months ago (2008-10-07 00:07:59 UTC) #5
Avi (use Gerrit)
http://codereview.chromium.org/4049/diff/649/652 File net/base/tcp_client_socket.h (right): http://codereview.chromium.org/4049/diff/649/652#newcode31 Line 31: // The Linux implementation supports full duplex because ...
12 years, 2 months ago (2008-10-07 21:42:24 UTC) #6
Avi (use Gerrit)
http://codereview.chromium.org/4049/diff/649/651 File net/base/tcp_client_socket_libevent.cc (right): http://codereview.chromium.org/4049/diff/649/651#newcode156 Line 156: DCHECK(!callback_); If we're going for full-duplex, we have ...
12 years, 2 months ago (2008-10-07 21:46:45 UTC) #7
wtc
Here are the review comments on nss_memio.{h,c} and ssl_client_socket.h. I will review ssl_client_socket_nss.cc and ssl_client_socket_unittests.cc ...
12 years, 2 months ago (2008-10-07 23:54:45 UTC) #8
wtc
OK, finally finished the review. There are quite a few issues, but it's impressive work. ...
12 years, 2 months ago (2008-10-09 00:03:00 UTC) #9
wtc
Dan, I can create a CL to turn SSLClientSocket into an interface, and then you ...
12 years, 2 months ago (2008-10-09 00:10:14 UTC) #10
Avi (use Gerrit)
On 2008/10/09 00:10:14, wtc wrote: > Dan, I can create a CL to turn SSLClientSocket ...
12 years, 2 months ago (2008-10-10 18:53:58 UTC) #11
Avi (use Gerrit)
http://codereview.chromium.org/4049/diff/649/653 File net/base/ssl_client_socket_unittest.cc (right): http://codereview.chromium.org/4049/diff/649/653#newcode87 Line 87: EXPECT_EQ(static_cast<int>(arraysize(request_text) - 1), rv); Since arraysize is a ...
12 years, 2 months ago (2008-10-10 19:00:58 UTC) #12
Avi (use Gerrit)
http://codereview.chromium.org/4049/diff/649/654 File net/base/ssl_client_socket_nss.cc (right): http://codereview.chromium.org/4049/diff/649/654#newcode183 Line 183: memset(ssl_info, 0, sizeof(ssl_info)); sizeof(SSLInfo) not the sizeof the ...
12 years, 2 months ago (2008-10-10 19:26:47 UTC) #13
dank
Ready for review again. I think I've addressed everybody's issues. The code is now based ...
12 years, 2 months ago (2008-10-16 22:32:27 UTC) #14
Avi (use Gerrit)
http://codereview.chromium.org/4049/diff/649/651 File net/base/tcp_client_socket_libevent.cc (right): http://codereview.chromium.org/4049/diff/649/651#newcode156 Line 156: DCHECK(!callback_); On 2008/10/16 22:32:28, dank wrote: > The ...
12 years, 2 months ago (2008-10-17 14:32:00 UTC) #15
Avi (use Gerrit)
http://codereview.chromium.org/4049/diff/680/685 File net/base/ssl_client_socket_nss.cc (right): http://codereview.chromium.org/4049/diff/680/685#newcode165 Line 165: memset(ssl_info, 0, sizeof(ssl_info)); sizeof(SSLInfo) not the sizeof the ...
12 years, 2 months ago (2008-10-17 15:32:56 UTC) #16
Avi (use Gerrit)
lgtm with comments. http://codereview.chromium.org/4049/diff/1054/1055 File net/SConscript (right): http://codereview.chromium.org/4049/diff/1054/1055#newcode280 Line 280: 'base/ssl_client_socket_unittest.cc', The SSL unit tests ...
12 years, 2 months ago (2008-10-20 15:03:00 UTC) #17
wtc
On 2008/10/10 19:00:58, Avi wrote: > > Line 87: EXPECT_EQ(static_cast<int>(arraysize(request_text) - 1), rv); > Since ...
12 years, 2 months ago (2008-10-20 18:19:40 UTC) #18
wtc
12 years, 2 months ago (2008-10-20 19:17:46 UTC) #19
LGTM.

I reviewed the latest patch set quickly.  (I plan to review the code again in
the future when we start to tackle the TODO issues.)  I also reviewed all the
comments from you and Avi since my last review.

http://codereview.chromium.org/4049/diff/1054/1064
File base/nss_init.cc (right):

http://codereview.chromium.org/4049/diff/1054/1064#newcode10
Line 10: // else base/lock.h will barf.
Sorry about this.  This is NSS bug
https://bugzilla.mozilla.org/show_bug.cgi?id=455424.  It'll be fixed in the
upcoming NSS 3.12.2 release.

http://codereview.chromium.org/4049/diff/1054/1055
File net/SConscript (right):

http://codereview.chromium.org/4049/diff/1054/1055#newcode136
Line 136: if env['PLATFORM'] == 'posix':
Just curious: in SConscript, does 'posix' include Mac OS X?

(In C++ code, OS_POSIX includes both Mac and Linux.)

http://codereview.chromium.org/4049/diff/1054/1055#newcode138
Line 138: # TODO(tc): gnome-vfs? xdgmime? /etc/mime.types?
You may want to keep this comment right above
'base/platform_mime_util_linux.cc'.  I think this comment applies to that file
only.

http://codereview.chromium.org/4049/diff/1054/1061
File net/base/nss_memio.c (right):

http://codereview.chromium.org/4049/diff/1054/1061#newcode64
Line 64: /* Forward declarations.  They don't seem to be needed -- are they? */
Remove "They don't seem to be needed -- are they?".

In C/C++, forward declarations are not needed if the functions are defined in
the right order.  But it never hurts for use forward declarations.

http://codereview.chromium.org/4049/diff/1054/1060
File net/base/nss_memio.h (right):

http://codereview.chromium.org/4049/diff/1054/1060#newcode60
Line 60: * If bytes_read is < 0, it is treated as an NSS error code.
Nit: "NSS error code" => "NSPR error code" (four occurrences in this file)

http://codereview.chromium.org/4049/diff/1054/1058
File net/base/ssl_client_socket_unittest.cc (right):

http://codereview.chromium.org/4049/diff/1054/1058#newcode37
Line 37: // Test suite redirects all hostname resolution requests to 127.0.0.1
anyway.
I agree with Avi that we should not need any of the changes to
ssl_client_socket_unittest.cc.

http://codereview.chromium.org/4049/diff/1054/1057
File net/base/tcp_client_socket.h (right):

http://codereview.chromium.org/4049/diff/1054/1057#newcode57
Line 57: // on Windows (only supported on Linux for ssl_client_socket_nss).
"only supported on Linux for ssl_client_socket_nss" is not accurate because full
duplex mode is also supported on Mac.

Powered by Google App Engine
This is Rietveld 408576698