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

Side by Side Diff: net/socket/ssl_server_socket.h

Issue 5746003: Defines SSLServerSocket and implements SSLServerSocketNSS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix style Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
wtc 2010/12/17 00:16:26 Nit: 2006-2009 => 2010
Alpha Left Google 2010/12/17 08:30:43 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_H_
6 #define NET_SOCKET_SSL_SERVER_SOCKET_H_
7
8 #include "base/basictypes.h"
9 #include "net/base/completion_callback.h"
10 #include "net/socket/socket.h"
11
12 namespace base {
13 class RSAPrivateKey;
14 } // namespace base
15
16 namespace net {
17
18 class IOBuffer;
19 class X509Certificate;
20
21 // SSLServerSocket takes an already connected socket and performs SSL
22 // authentication and encryption on top of it.
wtc 2010/12/17 00:16:26 Nit: remove "authentication and encryption".
Alpha Left Google 2010/12/17 08:30:43 Done.
23 class SSLServerSocket : public Socket {
24 public:
25 SSLServerSocket() {}
wtc 2010/12/17 00:16:26 Delete the constructor, and the four 'Socket' inte
26 virtual ~SSLServerSocket() {}
27
28 // Performs SSL server handshaking on an existing socket. The socket given
29 // to this object has to be already connected.
30 //
31 // This method takes a callback. Return true value of this method is the
wtc 2010/12/17 00:16:26 Nit: Return true value => Return value
Alpha Left Google 2010/12/17 08:30:43 Done.
32 // error code of the handshaking operation. If the return value is
33 // net::ERR_IO_PENDING the given callback will be invoked in the future with
34 // an error code. Other values of error code returned by this method indicate
35 // the handshaking operation has completed synchronously.
36 virtual int Accept(CompletionCallback* callback) = 0;
37
38 // Socket interface.
39 virtual int Read(IOBuffer* buf, int buf_len,
40 CompletionCallback* callback) = 0;
41 virtual int Write(IOBuffer* buf, int buf_len,
42 CompletionCallback* callback) = 0;
43 virtual bool SetReceiveBufferSize(int32 size) = 0;
44 virtual bool SetSendBufferSize(int32 size) = 0;
45
46 private:
47 DISALLOW_COPY_AND_ASSIGN(SSLServerSocket);
48 };
49
50 // Creates a SSL server socket using a already connected socket. A signed
wtc 2010/12/17 00:16:26 Nit: a SSL => an SSL a already => an already
Alpha Left Google 2010/12/17 08:30:43 Fixed nits. Added a TODO to define ServerSocketFac
51 // certificate and private key needs to be provided.
52 //
53 // This created server socket will take ownership of |socket|. However |key|
wtc 2010/12/17 00:16:26 Since we can't copy a base::RSAPrivateKey easily,
Alpha Left Google 2010/12/17 08:30:43 In the case of chromoting this is not desirable. B
wtc 2010/12/17 16:38:32 I see. Perhaps the proper solution is to make RSA
Alpha Left Google 2010/12/17 20:09:57 Added TODO to RSAPrivateKey.
54 // is copied.
55 SSLServerSocket* CreateSSLServerSocket(
56 Socket* socket, scoped_refptr<X509Certificate> certificate,
wtc 2010/12/17 00:16:26 Just use X509Certificate* certificate. No need to
Alpha Left Google 2010/12/17 08:30:43 Done.
57 base::RSAPrivateKey* key);
58
59 } // namespace net
60
61 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698