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

Side by Side Diff: remoting/protocol/jingle_stream_connector.h

Issue 9240033: Use scoped_ptr<>.Pass() to pass ownership in the remoting protocol code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ 5 #ifndef REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_
6 #define REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ 6 #define REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 24 matching lines...) Expand all
35 // based on a secret shared by the two parties, and keying material derived 35 // based on a secret shared by the two parties, and keying material derived
36 // from the SSL session's master secret and nonces. 36 // from the SSL session's master secret and nonces.
37 class JingleStreamConnector : public JingleChannelConnector { 37 class JingleStreamConnector : public JingleChannelConnector {
38 public: 38 public:
39 JingleStreamConnector(JingleSession* session, 39 JingleStreamConnector(JingleSession* session,
40 const std::string& name, 40 const std::string& name,
41 const Session::StreamChannelCallback& callback); 41 const Session::StreamChannelCallback& callback);
42 virtual ~JingleStreamConnector(); 42 virtual ~JingleStreamConnector();
43 43
44 // JingleChannelConnector implementation. 44 // JingleChannelConnector implementation.
45 virtual void Connect(ChannelAuthenticator* authenticator, 45 virtual void Connect(scoped_ptr<ChannelAuthenticator> authenticator,
46 cricket::TransportChannel* raw_channel) OVERRIDE; 46 cricket::TransportChannel* raw_channel) OVERRIDE;
47 47
48 private: 48 private:
49 bool EstablishTCPConnection(net::Socket* socket); 49 bool EstablishTCPConnection(net::Socket* socket);
50 void OnTCPConnect(int result); 50 void OnTCPConnect(int result);
51 void OnAuthenticationDone(net::Error error, net::StreamSocket* socket); 51 void OnAuthenticationDone(net::Error error, net::StreamSocket* socket);
52 52
53 void NotifyDone(net::StreamSocket* socket); 53 void NotifyDone(net::StreamSocket* socket);
54 void NotifyError(); 54 void NotifyError();
55 55
56 JingleSession* session_; 56 JingleSession* session_;
57 std::string name_; 57 std::string name_;
58 Session::StreamChannelCallback callback_; 58 Session::StreamChannelCallback callback_;
59 59
60 cricket::TransportChannel* raw_channel_; 60 cricket::TransportChannel* raw_channel_;
61 scoped_ptr<net::StreamSocket> tcp_socket_; 61 scoped_ptr<net::StreamSocket> tcp_socket_;
62 scoped_ptr<net::SSLSocket> socket_; 62 scoped_ptr<net::SSLSocket> socket_;
63 63
64 scoped_ptr<ChannelAuthenticator> authenticator_; 64 scoped_ptr<ChannelAuthenticator> authenticator_;
65 65
66 DISALLOW_COPY_AND_ASSIGN(JingleStreamConnector); 66 DISALLOW_COPY_AND_ASSIGN(JingleStreamConnector);
67 }; 67 };
68 68
69 } // namespace protocol 69 } // namespace protocol
70 } // namespace remoting 70 } // namespace remoting
71 71
72 #endif // REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ 72 #endif // REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698