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

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

Issue 10692179: Propagate connection state from networking layer to UI. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file defines the interface for peer-to-peer transport. There 5 // This file defines the interface for peer-to-peer transport. There
6 // are two types of transport: StreamTransport and DatagramTransport. 6 // are two types of transport: StreamTransport and DatagramTransport.
7 // They must both be created using TransportFactory instances and they 7 // They must both be created using TransportFactory instances and they
8 // provide the same interface, except that one should be used for 8 // provide the same interface, except that one should be used for
9 // reliable stream connection and the other one for unreliable 9 // reliable stream connection and the other one for unreliable
10 // datagram connection. The Transport interface itself doesn't provide 10 // datagram connection. The Transport interface itself doesn't provide
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // to be passed to the AddRemoteCandidate() method on the remote 74 // to be passed to the AddRemoteCandidate() method on the remote
75 // end of the connection. 75 // end of the connection.
76 virtual void OnTransportCandidate(Transport* transport, 76 virtual void OnTransportCandidate(Transport* transport,
77 const cricket::Candidate& candidate) = 0; 77 const cricket::Candidate& candidate) = 0;
78 78
79 // Called when transport route changes. Can be called even before 79 // Called when transport route changes. Can be called even before
80 // the transport is connected. 80 // the transport is connected.
81 virtual void OnTransportRouteChange(Transport* transport, 81 virtual void OnTransportRouteChange(Transport* transport,
82 const TransportRoute& route) = 0; 82 const TransportRoute& route) = 0;
83 83
84 // Called when the transport inactivity state changes. When
85 // |inactive| is set to true incoming and outgoing data may be
86 // delayed until connection goes back to the active state, at
87 // which point that method is called again with |inactive| set to
88 // false. This is useful for UI indication of temporarily broken
89 // connections.
Wez 2012/07/16 18:51:23 nit: Re-express this as the transport being "ready
Sergey Ulanov 2012/07/17 01:17:17 Done.
90 virtual void OnTransportInactive(Transport* transport, bool inactive) = 0;
91
84 // Called when the transport is about to be deleted. 92 // Called when the transport is about to be deleted.
85 virtual void OnTransportDeleted(Transport* transport) = 0; 93 virtual void OnTransportDeleted(Transport* transport) = 0;
86 }; 94 };
87 95
88 Transport() {} 96 Transport() {}
89 virtual ~Transport() {} 97 virtual ~Transport() {}
90 98
91 // Intialize the transport with the specified parameters. 99 // Intialize the transport with the specified parameters.
92 // |authenticator| is used to secure and authenticate the connection. 100 // |authenticator| is used to secure and authenticate the connection.
93 virtual void Initialize(const std::string& name, 101 virtual void Initialize(const std::string& name,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() = 0; 155 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() = 0;
148 156
149 private: 157 private:
150 DISALLOW_COPY_AND_ASSIGN(TransportFactory); 158 DISALLOW_COPY_AND_ASSIGN(TransportFactory);
151 }; 159 };
152 160
153 } // namespace protocol 161 } // namespace protocol
154 } // namespace remoting 162 } // namespace remoting
155 163
156 #endif // REMOTING_PROTOCOL_TRANSPORT_H_ 164 #endif // REMOTING_PROTOCOL_TRANSPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698