diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 16:53:42 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 16:53:42 +0000 |
commit | ba62fbd428232eee1815d4b4d63fc65cb3ead566 (patch) | |
tree | 56d05f663fe81afc7c7f6c232d1f650994bbe8ed /remoting/jingle_glue/xmpp_socket_adapter.h | |
parent | a538b1cdbd69c307ef672b5176c8ac9039981c41 (diff) | |
download | chromium_src-ba62fbd428232eee1815d4b4d63fc65cb3ead566.zip chromium_src-ba62fbd428232eee1815d4b4d63fc65cb3ead566.tar.gz chromium_src-ba62fbd428232eee1815d4b4d63fc65cb3ead566.tar.bz2 |
Revert r59012 which started using Chrome sockets for sync.
This caused us to write to ChromeNetLog from the sync thread. ChromeNetLog is not thread safe, so this causes problems.
BUG=55116,54146
TEST=Start up chrome. Does not repeatedly hit DCHECKs on ChromeNetLog::AddEntry().
Review URL: http://codereview.chromium.org/3358028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/jingle_glue/xmpp_socket_adapter.h')
-rw-r--r-- | remoting/jingle_glue/xmpp_socket_adapter.h | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/remoting/jingle_glue/xmpp_socket_adapter.h b/remoting/jingle_glue/xmpp_socket_adapter.h deleted file mode 100644 index d1a6f65..0000000 --- a/remoting/jingle_glue/xmpp_socket_adapter.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2009 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 REMOTING_JINGLE_GLUE_XMPP_SOCKET_ADAPTER_H_ -#define REMOTING_JINGLE_GLUE_XMPP_SOCKET_ADAPTER_H_ - -#include <string> - -#include "talk/base/asyncsocket.h" -#include "talk/xmpp/asyncsocket.h" -#include "talk/xmpp/xmppclientsettings.h" -#include "talk/xmpp/xmppengine.h" - -#ifndef _WIN32 -// Additional errors used by us from Win32 headers. -#define SEC_E_CERT_EXPIRED static_cast<int>(0x80090328L) -#define WSA_NOT_ENOUGH_MEMORY ENOMEM -#endif - -namespace remoting { - -class XmppSocketAdapter : public buzz::AsyncSocket, - public sigslot::has_slots<> { - public: - XmppSocketAdapter(const buzz::XmppClientSettings& xcs, - bool allow_unverified_certs); - virtual ~XmppSocketAdapter(); - - virtual State state() { return state_; } - virtual Error error() { return error_; } - virtual int GetError() { return wsa_error_; } - - void set_firewall(bool firewall) { firewall_ = firewall; } - - virtual bool Connect(const talk_base::SocketAddress& addr); - virtual bool Read(char* data, size_t len, size_t* len_read); - virtual bool Write(const char* data, size_t len); - virtual bool Close(); - -#if defined(FEATURE_ENABLE_SSL) - bool StartTls(const std::string& domainname); - bool IsOpen() const { return state_ == STATE_OPEN - || state_ == STATE_TLS_OPEN; } -#else - bool IsOpen() const { return state_ == STATE_OPEN; } -#endif - - sigslot::signal0<> SignalAuthenticationError; - - private: - // Return false if the socket is closed. - bool HandleReadable(); - bool HandleWritable(); - - State state_; - Error error_; - int wsa_error_; - - talk_base::AsyncSocket* socket_; - cricket::ProtocolType protocol_; - talk_base::ProxyInfo proxy_; - bool firewall_; - char* write_buffer_; - size_t write_buffer_length_; - size_t write_buffer_capacity_; - bool allow_unverified_certs_; - - bool FreeState(); - void NotifyClose(); - - void OnReadEvent(talk_base::AsyncSocket* socket); - void OnWriteEvent(talk_base::AsyncSocket* socket); - void OnConnectEvent(talk_base::AsyncSocket* socket); - void OnCloseEvent(talk_base::AsyncSocket* socket, int error); - - void QueueWriteData(const char* data, size_t len); - void FlushWriteQueue(Error* error, int* wsa_error); - - void SetError(Error error); - void SetWSAError(int error); - DISALLOW_COPY_AND_ASSIGN(XmppSocketAdapter); -}; - -} // namespace remoting - -#endif // REMOTING_JINGLE_GLUE_XMPP_SOCKET_ADAPTER_H_ |