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

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

Issue 8046018: Parse termination reason and propagate the error to the Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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_PEPPER_SESSION_H_ 5 #ifndef REMOTING_PROTOCOL_PEPPER_SESSION_H_
6 #define REMOTING_PROTOCOL_PEPPER_SESSION_H_ 6 #define REMOTING_PROTOCOL_PEPPER_SESSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 class PepperChannel; 37 class PepperChannel;
38 class PepperSessionManager; 38 class PepperSessionManager;
39 class SocketWrapper; 39 class SocketWrapper;
40 40
41 // Implements the protocol::Session interface using the Pepper P2P 41 // Implements the protocol::Session interface using the Pepper P2P
42 // Transport API. Created by PepperSessionManager for incoming and 42 // Transport API. Created by PepperSessionManager for incoming and
43 // outgoing connections. 43 // outgoing connections.
44 class PepperSession : public Session { 44 class PepperSession : public Session {
45 public: 45 public:
46 // TODO(sergeyu): Move this type and error() method to the Session
47 // interface.
48 enum Error {
49 ERROR_NO_ERROR = 0,
50 ERROR_PEER_IS_OFFLINE,
51 ERROR_SESSION_REJECTED,
52 ERROR_INCOMPATIBLE_PROTOCOL,
53 ERROR_CHANNEL_CONNECTION_FAILURE,
54 };
55
56 virtual ~PepperSession(); 46 virtual ~PepperSession();
57 47
58 Error error();
59
60 // Session interface. 48 // Session interface.
61 virtual void SetStateChangeCallback(StateChangeCallback* callback) OVERRIDE; 49 virtual void SetStateChangeCallback(StateChangeCallback* callback) OVERRIDE;
50 virtual Error error() OVERRIDE;
62 virtual void CreateStreamChannel( 51 virtual void CreateStreamChannel(
63 const std::string& name, 52 const std::string& name,
64 const StreamChannelCallback& callback) OVERRIDE; 53 const StreamChannelCallback& callback) OVERRIDE;
65 virtual void CreateDatagramChannel( 54 virtual void CreateDatagramChannel(
66 const std::string& name, 55 const std::string& name,
67 const DatagramChannelCallback& callback) OVERRIDE; 56 const DatagramChannelCallback& callback) OVERRIDE;
68 virtual net::Socket* control_channel() OVERRIDE; 57 virtual net::Socket* control_channel() OVERRIDE;
69 virtual net::Socket* event_channel() OVERRIDE; 58 virtual net::Socket* event_channel() OVERRIDE;
70 virtual const std::string& jid() OVERRIDE; 59 virtual const std::string& jid() OVERRIDE;
71 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; 60 virtual const CandidateSessionConfig* candidate_config() OVERRIDE;
(...skipping 28 matching lines...) Expand all
100 // Called when an error occurs. Sets |error_| and closes the session. 89 // Called when an error occurs. Sets |error_| and closes the session.
101 void OnError(Error error); 90 void OnError(Error error);
102 91
103 // Called by PepperSessionManager on incoming |message|. Must fill 92 // Called by PepperSessionManager on incoming |message|. Must fill
104 // in |reply|. 93 // in |reply|.
105 void OnIncomingMessage(const JingleMessage& message, 94 void OnIncomingMessage(const JingleMessage& message,
106 JingleMessageReply* reply); 95 JingleMessageReply* reply);
107 96
108 // Message handlers for incoming messages. 97 // Message handlers for incoming messages.
109 void OnAccept(const JingleMessage& message, JingleMessageReply* reply); 98 void OnAccept(const JingleMessage& message, JingleMessageReply* reply);
110 void OnReject(const JingleMessage& message, JingleMessageReply* reply);
111 void OnTerminate(const JingleMessage& message, JingleMessageReply* reply); 99 void OnTerminate(const JingleMessage& message, JingleMessageReply* reply);
112 void ProcessTransportInfo(const JingleMessage& message); 100 void ProcessTransportInfo(const JingleMessage& message);
113 101
114 // Called from OnAccept() to initialize session config. 102 // Called from OnAccept() to initialize session config.
115 bool InitializeConfigFromDescription(const ContentDescription* description); 103 bool InitializeConfigFromDescription(const ContentDescription* description);
116 104
117 // Called by PepperChannel. 105 // Called by PepperChannel.
118 void AddLocalCandidate(const cricket::Candidate& candidate); 106 void AddLocalCandidate(const cricket::Candidate& candidate);
119 void OnDeleteChannel(PepperChannel* channel); 107 void OnDeleteChannel(PepperChannel* channel);
120 108
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 base::OneShotTimer<PepperSession> transport_infos_timer_; 147 base::OneShotTimer<PepperSession> transport_infos_timer_;
160 std::list<cricket::Candidate> pending_candidates_; 148 std::list<cricket::Candidate> pending_candidates_;
161 149
162 DISALLOW_COPY_AND_ASSIGN(PepperSession); 150 DISALLOW_COPY_AND_ASSIGN(PepperSession);
163 }; 151 };
164 152
165 } // namespace protocol 153 } // namespace protocol
166 } // namespace remoting 154 } // namespace remoting
167 155
168 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_H_ 156 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698