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

Unified Diff: net/socket/socks_client_socket.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « net/socket/socks5_client_socket_unittest.cc ('k') | net/socket/socks_client_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socks_client_socket.h
diff --git a/net/socket/socks_client_socket.h b/net/socket/socks_client_socket.h
deleted file mode 100644
index e792881cc7f3167b5a1ddf174e09ad838cbe6959..0000000000000000000000000000000000000000
--- a/net/socket/socks_client_socket.h
+++ /dev/null
@@ -1,140 +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.
-
-#ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
-#define NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "net/base/address_list.h"
-#include "net/base/completion_callback.h"
-#include "net/base/net_errors.h"
-#include "net/base/net_log.h"
-#include "net/dns/host_resolver.h"
-#include "net/dns/single_request_host_resolver.h"
-#include "net/socket/stream_socket.h"
-
-namespace net {
-
-class ClientSocketHandle;
-class BoundNetLog;
-
-// The SOCKS client socket implementation
-class NET_EXPORT_PRIVATE SOCKSClientSocket : public StreamSocket {
- public:
- // |req_info| contains the hostname and port to which the socket above will
- // communicate to via the socks layer. For testing the referrer is optional.
- SOCKSClientSocket(scoped_ptr<ClientSocketHandle> transport_socket,
- const HostResolver::RequestInfo& req_info,
- RequestPriority priority,
- HostResolver* host_resolver);
-
- // On destruction Disconnect() is called.
- ~SOCKSClientSocket() override;
-
- // StreamSocket implementation.
-
- // Does the SOCKS handshake and completes the protocol.
- int Connect(const CompletionCallback& callback) override;
- void Disconnect() override;
- bool IsConnected() const override;
- bool IsConnectedAndIdle() const override;
- const BoundNetLog& NetLog() const override;
- void SetSubresourceSpeculation() override;
- void SetOmniboxSpeculation() override;
- bool WasEverUsed() const override;
- bool UsingTCPFastOpen() const override;
- bool WasNpnNegotiated() const override;
- NextProto GetNegotiatedProtocol() const override;
- bool GetSSLInfo(SSLInfo* ssl_info) override;
-
- // Socket implementation.
- int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
-
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
-
- int GetPeerAddress(IPEndPoint* address) const override;
- int GetLocalAddress(IPEndPoint* address) const override;
-
- private:
- FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, CompleteHandshake);
- FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, SOCKS4AFailedDNS);
- FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, SOCKS4AIfDomainInIPv6);
-
- enum State {
- STATE_RESOLVE_HOST,
- STATE_RESOLVE_HOST_COMPLETE,
- STATE_HANDSHAKE_WRITE,
- STATE_HANDSHAKE_WRITE_COMPLETE,
- STATE_HANDSHAKE_READ,
- STATE_HANDSHAKE_READ_COMPLETE,
- STATE_NONE,
- };
-
- void DoCallback(int result);
- void OnIOComplete(int result);
- void OnReadWriteComplete(const CompletionCallback& callback, int result);
-
- int DoLoop(int last_io_result);
- int DoResolveHost();
- int DoResolveHostComplete(int result);
- int DoHandshakeRead();
- int DoHandshakeReadComplete(int result);
- int DoHandshakeWrite();
- int DoHandshakeWriteComplete(int result);
-
- const std::string BuildHandshakeWriteBuffer() const;
-
- // Stores the underlying socket.
- scoped_ptr<ClientSocketHandle> transport_;
-
- State next_state_;
-
- // Stores the callbacks to the layer above, called on completing Connect().
- CompletionCallback user_callback_;
-
- // This IOBuffer is used by the class to read and write
- // SOCKS handshake data. The length contains the expected size to
- // read or write.
- scoped_refptr<IOBuffer> handshake_buf_;
-
- // While writing, this buffer stores the complete write handshake data.
- // While reading, it stores the handshake information received so far.
- std::string buffer_;
-
- // This becomes true when the SOCKS handshake has completed and the
- // overlying connection is free to communicate.
- bool completed_handshake_;
-
- // These contain the bytes sent / received by the SOCKS handshake.
- size_t bytes_sent_;
- size_t bytes_received_;
-
- // This becomes true when the socket is used to send or receive data.
- bool was_ever_used_;
-
- // Used to resolve the hostname to which the SOCKS proxy will connect.
- SingleRequestHostResolver host_resolver_;
- AddressList addresses_;
- HostResolver::RequestInfo host_request_info_;
- RequestPriority priority_;
-
- BoundNetLog net_log_;
-
- DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket);
-};
-
-} // namespace net
-
-#endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
« no previous file with comments | « net/socket/socks5_client_socket_unittest.cc ('k') | net/socket/socks_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698