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

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

Issue 6833031: Changed the jingle network code in ChromeAsyncSocket to use the client socket pool. This also all... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: More Mac/Linux compile fixes Created 9 years, 8 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/proxy_resolving_client_socket.h
===================================================================
--- jingle/notifier/base/proxy_resolving_client_socket.h (revision 0)
+++ jingle/notifier/base/proxy_resolving_client_socket.h (revision 0)
@@ -0,0 +1,92 @@
+// Copyright (c) 2011 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 ClientSocket implementation wraps a ClientSocketHandle that is created
+// from the client socket pool after resolving proxies.
+
+#ifndef JINGLE_NOTIFIER_BASE_PROXY_RESOLVING_CLIENT_SOCKET_H_
+#define JINGLE_NOTIFIER_BASE_PROXY_RESOLVING_CLIENT_SOCKET_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "net/base/completion_callback.h"
+#include "net/base/host_port_pair.h"
+#include "net/base/net_errors.h"
+#include "net/base/net_log.h"
+#include "net/base/ssl_config_service.h"
+#include "net/proxy/proxy_info.h"
+#include "net/proxy/proxy_service.h"
+#include "net/socket/client_socket.h"
+
+namespace net {
+class ClientSocketHandle;
+class HttpNetworkSession;
+class URLRequestContextGetter;
+} // namespace net
+
+namespace notifier {
+
akalin 2011/04/14 21:54:50 Add TODO to move this to net/
sanjeevr 2011/04/14 23:15:43 Done.
+class ProxyResolvingClientSocket : public net::ClientSocket {
+ public:
+ ProxyResolvingClientSocket(
+ const scoped_refptr<net::URLRequestContextGetter>&
+ request_context_getter,
+ const net::SSLConfig& ssl_config,
+ const net::HostPortPair& dest_host_port_pair,
+ net::NetLog* net_log);
+ virtual ~ProxyResolvingClientSocket();
+
+ // net::ClientSocket implementation.
+ virtual int Read(net::IOBuffer* buf, int buf_len,
akalin 2011/04/14 21:54:50 Add OVERRIDE to overridden methods
sanjeevr 2011/04/14 23:15:43 Done.
+ net::CompletionCallback* callback);
+ virtual int Write(net::IOBuffer* buf, int buf_len,
+ net::CompletionCallback* callback);
+ virtual bool SetReceiveBufferSize(int32 size);
+ virtual bool SetSendBufferSize(int32 size);
+ virtual int Connect(net::CompletionCallback* callback);
+ virtual void Disconnect();
+ virtual bool IsConnected() const;
+ virtual bool IsConnectedAndIdle() const;
+ virtual int GetPeerAddress(net::AddressList* address) const;
+ virtual const net::BoundNetLog& NetLog() const;
+ virtual void SetSubresourceSpeculation();
+ virtual void SetOmniboxSpeculation();
+ virtual bool WasEverUsed() const;
+ virtual bool UsingTCPFastOpen() const;
+
+ private:
+ // Proxy resolution and connection functions.
+ void ProcessProxyResolveDone(int status);
+ void ProcessConnectDone(int status);
+
+ void CloseTransportSocket();
+ void RunUserConnectCallback(int status);
+ int ReconsiderProxyAfterError(int error);
+
+ // Callbacks passed to net APIs.
+ net::CompletionCallbackImpl<ProxyResolvingClientSocket>
+ proxy_resolve_callback_;
+ net::CompletionCallbackImpl<ProxyResolvingClientSocket> connect_callback_;
+
+ scoped_refptr<net::HttpNetworkSession> network_session_;
+
+ // The transport socket.
+ const net::SSLConfig ssl_config_;
+ scoped_ptr<net::ClientSocketHandle> transport_;
+ net::ProxyService::PacRequest* pac_request_;
+ net::ProxyInfo proxy_info_;
+ net::HostPortPair dest_host_port_pair_;
+ bool tried_direct_connect_fallback_;
+ net::BoundNetLog bound_net_log_;
+ ScopedRunnableMethodFactory<ProxyResolvingClientSocket>
+ scoped_runnable_method_factory_;
+
+ // The callback passed to Connect().
+ net::CompletionCallback* user_connect_callback_;
+};
+
+} // namespace notifier
+
+#endif // JINGLE_NOTIFIER_BASE_PROXY_RESOLVING_CLIENT_SOCKET_H_
Property changes on: jingle\notifier\base\proxy_resolving_client_socket.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698