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

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

Issue 9567033: Cleanup error handling in the client plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 9 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
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 25 matching lines...) Expand all
36 class JingleSession : public Session, 36 class JingleSession : public Session,
37 public Transport::EventHandler { 37 public Transport::EventHandler {
38 public: 38 public:
39 virtual ~JingleSession(); 39 virtual ~JingleSession();
40 40
41 // Session interface. 41 // Session interface.
42 virtual void SetStateChangeCallback( 42 virtual void SetStateChangeCallback(
43 const StateChangeCallback& callback) OVERRIDE; 43 const StateChangeCallback& callback) OVERRIDE;
44 virtual void SetRouteChangeCallback( 44 virtual void SetRouteChangeCallback(
45 const RouteChangeCallback& callback) OVERRIDE; 45 const RouteChangeCallback& callback) OVERRIDE;
46 virtual Error error() OVERRIDE; 46 virtual ErrorCode error() OVERRIDE;
47 virtual void CreateStreamChannel( 47 virtual void CreateStreamChannel(
48 const std::string& name, 48 const std::string& name,
49 const StreamChannelCallback& callback) OVERRIDE; 49 const StreamChannelCallback& callback) OVERRIDE;
50 virtual void CreateDatagramChannel( 50 virtual void CreateDatagramChannel(
51 const std::string& name, 51 const std::string& name,
52 const DatagramChannelCallback& callback) OVERRIDE; 52 const DatagramChannelCallback& callback) OVERRIDE;
53 virtual void CancelChannelCreation(const std::string& name) OVERRIDE; 53 virtual void CancelChannelCreation(const std::string& name) OVERRIDE;
54 virtual const std::string& jid() OVERRIDE; 54 virtual const std::string& jid() OVERRIDE;
55 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; 55 virtual const CandidateSessionConfig* candidate_config() OVERRIDE;
56 virtual const SessionConfig& config() OVERRIDE; 56 virtual const SessionConfig& config() OVERRIDE;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Called from OnAccept() to initialize session config. 112 // Called from OnAccept() to initialize session config.
113 bool InitializeConfigFromDescription(const ContentDescription* description); 113 bool InitializeConfigFromDescription(const ContentDescription* description);
114 114
115 void ProcessAuthenticationStep(); 115 void ProcessAuthenticationStep();
116 116
117 void SendTransportInfo(); 117 void SendTransportInfo();
118 118
119 // Terminates the session and sends session-terminate if it is 119 // Terminates the session and sends session-terminate if it is
120 // necessary. |error| specifies the error code in case when the 120 // necessary. |error| specifies the error code in case when the
121 // session is being closed due to an error. 121 // session is being closed due to an error.
122 void CloseInternal(Error error); 122 void CloseInternal(ErrorCode error);
123 123
124 // Sets |state_| to |new_state| and calls state change callback. 124 // Sets |state_| to |new_state| and calls state change callback.
125 void SetState(State new_state); 125 void SetState(State new_state);
126 126
127 JingleSessionManager* session_manager_; 127 JingleSessionManager* session_manager_;
128 std::string peer_jid_; 128 std::string peer_jid_;
129 scoped_ptr<CandidateSessionConfig> candidate_config_; 129 scoped_ptr<CandidateSessionConfig> candidate_config_;
130 StateChangeCallback state_change_callback_; 130 StateChangeCallback state_change_callback_;
131 RouteChangeCallback route_change_callback_; 131 RouteChangeCallback route_change_callback_;
132 132
133 std::string session_id_; 133 std::string session_id_;
134 State state_; 134 State state_;
135 Error error_; 135 ErrorCode error_;
136 136
137 SessionConfig config_; 137 SessionConfig config_;
138 bool config_is_set_; 138 bool config_is_set_;
139 139
140 scoped_ptr<Authenticator> authenticator_; 140 scoped_ptr<Authenticator> authenticator_;
141 141
142 // Container for pending Iq requests. Requests are removed in 142 // Container for pending Iq requests. Requests are removed in
143 // CleanupPendingRequests() which is called when a response is 143 // CleanupPendingRequests() which is called when a response is
144 // received or one of the requests times out. 144 // received or one of the requests times out.
145 std::list<IqRequest*> pending_requests_; 145 std::list<IqRequest*> pending_requests_;
146 146
147 ChannelsMap channels_; 147 ChannelsMap channels_;
148 148
149 base::OneShotTimer<JingleSession> transport_infos_timer_; 149 base::OneShotTimer<JingleSession> transport_infos_timer_;
150 std::list<cricket::Candidate> pending_candidates_; 150 std::list<cricket::Candidate> pending_candidates_;
151 151
152 DISALLOW_COPY_AND_ASSIGN(JingleSession); 152 DISALLOW_COPY_AND_ASSIGN(JingleSession);
153 }; 153 };
154 154
155 } // namespace protocol 155 } // namespace protocol
156 } // namespace remoting 156 } // namespace remoting
157 157
158 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_H_ 158 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_H_
OLDNEW
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698