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

Unified Diff: jingle/notifier/base/fake_ssl_client_socket.h

Issue 10817013: Move ChromeAsyncSocket to jingle/glue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/base/fake_ssl_client_socket.h
diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h
deleted file mode 100644
index b9df8a6765d22062e3cdc398a1628bad4755cce6..0000000000000000000000000000000000000000
--- a/jingle/notifier/base/fake_ssl_client_socket.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// This StreamSocket implementation is to be used with servers that
-// accept connections on port 443 but don't really use SSL. For
-// example, the Google Talk servers do this to bypass proxies. (The
-// connection is upgraded to TLS as part of the XMPP negotiation, so
-// security is preserved.) A "fake" SSL handshake is done immediately
-// after connection to fool proxies into thinking that this is a real
-// SSL connection.
-//
-// NOTE: This StreamSocket implementation does *not* do a real SSL
-// handshake nor does it do any encryption!
-
-#ifndef JINGLE_NOTIFIER_BASE_FAKE_SSL_CLIENT_SOCKET_H_
-#define JINGLE_NOTIFIER_BASE_FAKE_SSL_CLIENT_SOCKET_H_
-
-#include <cstddef>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/string_piece.h"
-#include "net/base/completion_callback.h"
-#include "net/base/net_errors.h"
-#include "net/socket/stream_socket.h"
-
-namespace net {
-class DrainableIOBuffer;
-class SSLInfo;
-} // namespace net
-
-namespace notifier {
-
-class FakeSSLClientSocket : public net::StreamSocket {
- public:
- // Takes ownership of |transport_socket|.
- explicit FakeSSLClientSocket(net::StreamSocket* transport_socket);
-
- virtual ~FakeSSLClientSocket();
-
- // Exposed for testing.
- static base::StringPiece GetSslClientHello();
- static base::StringPiece GetSslServerHello();
-
- // net::StreamSocket implementation.
- virtual int Read(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int Write(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual bool SetSendBufferSize(int32 size) OVERRIDE;
- virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE;
- virtual const net::BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual int64 NumBytesRead() const OVERRIDE;
- virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(net::SSLInfo* ssl_info) OVERRIDE;
-
- private:
- enum HandshakeState {
- STATE_NONE,
- STATE_CONNECT,
- STATE_SEND_CLIENT_HELLO,
- STATE_VERIFY_SERVER_HELLO,
- };
-
- int DoHandshakeLoop();
- void RunUserConnectCallback(int status);
- void DoHandshakeLoopWithUserConnectCallback();
-
- int DoConnect();
- void OnConnectDone(int status);
- void ProcessConnectDone();
-
- int DoSendClientHello();
- void OnSendClientHelloDone(int status);
- void ProcessSendClientHelloDone(size_t written);
-
- int DoVerifyServerHello();
- void OnVerifyServerHelloDone(int status);
- net::Error ProcessVerifyServerHelloDone(size_t read);
-
- scoped_ptr<net::StreamSocket> transport_socket_;
-
- // During the handshake process, holds a value from HandshakeState.
- // STATE_NONE otherwise.
- HandshakeState next_handshake_state_;
-
- // True iff we're connected and we've finished the handshake.
- bool handshake_completed_;
-
- // The callback passed to Connect().
- net::CompletionCallback user_connect_callback_;
-
- scoped_refptr<net::DrainableIOBuffer> write_buf_;
- scoped_refptr<net::DrainableIOBuffer> read_buf_;
-};
-
-} // namespace notifier
-
-#endif // JINGLE_NOTIFIER_BASE_FAKE_SSL_CLIENT_SOCKET_H_
« no previous file with comments | « jingle/notifier/base/chrome_async_socket_unittest.cc ('k') | jingle/notifier/base/fake_ssl_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698