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

Side by Side Diff: remoting/protocol/fake_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/errors.h ('k') | remoting/protocol/fake_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_FAKE_SESSION_H_ 5 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_
6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_ 6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 public: 133 public:
134 FakeSession(); 134 FakeSession();
135 virtual ~FakeSession(); 135 virtual ~FakeSession();
136 136
137 const StateChangeCallback& state_change_callback() { return callback_; } 137 const StateChangeCallback& state_change_callback() { return callback_; }
138 138
139 void set_message_loop(MessageLoop* message_loop) { 139 void set_message_loop(MessageLoop* message_loop) {
140 message_loop_ = message_loop; 140 message_loop_ = message_loop;
141 } 141 }
142 142
143 void set_error(Session::Error error) { error_ = error; } 143 void set_error(ErrorCode error) { error_ = error; }
144 144
145 bool is_closed() const { return closed_; } 145 bool is_closed() const { return closed_; }
146 146
147 FakeSocket* GetStreamChannel(const std::string& name); 147 FakeSocket* GetStreamChannel(const std::string& name);
148 FakeUdpSocket* GetDatagramChannel(const std::string& name); 148 FakeUdpSocket* GetDatagramChannel(const std::string& name);
149 149
150 // Session implementation. 150 // Session implementation.
151 virtual void SetStateChangeCallback( 151 virtual void SetStateChangeCallback(
152 const StateChangeCallback& callback) OVERRIDE; 152 const StateChangeCallback& callback) OVERRIDE;
153 153
154 virtual void SetRouteChangeCallback( 154 virtual void SetRouteChangeCallback(
155 const RouteChangeCallback& callback) OVERRIDE; 155 const RouteChangeCallback& callback) OVERRIDE;
156 156
157 virtual Session::Error error() OVERRIDE; 157 virtual ErrorCode error() OVERRIDE;
158 158
159 virtual void CreateStreamChannel( 159 virtual void CreateStreamChannel(
160 const std::string& name, const StreamChannelCallback& callback) OVERRIDE; 160 const std::string& name, const StreamChannelCallback& callback) OVERRIDE;
161 virtual void CreateDatagramChannel( 161 virtual void CreateDatagramChannel(
162 const std::string& name, 162 const std::string& name,
163 const DatagramChannelCallback& callback) OVERRIDE; 163 const DatagramChannelCallback& callback) OVERRIDE;
164 virtual void CancelChannelCreation(const std::string& name) OVERRIDE; 164 virtual void CancelChannelCreation(const std::string& name) OVERRIDE;
165 165
166 virtual const std::string& jid() OVERRIDE; 166 virtual const std::string& jid() OVERRIDE;
167 167
168 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; 168 virtual const CandidateSessionConfig* candidate_config() OVERRIDE;
169 virtual const SessionConfig& config() OVERRIDE; 169 virtual const SessionConfig& config() OVERRIDE;
170 virtual void set_config(const SessionConfig& config) OVERRIDE; 170 virtual void set_config(const SessionConfig& config) OVERRIDE;
171 171
172 virtual void Close() OVERRIDE; 172 virtual void Close() OVERRIDE;
173 173
174 public: 174 public:
175 StateChangeCallback callback_; 175 StateChangeCallback callback_;
176 scoped_ptr<const CandidateSessionConfig> candidate_config_; 176 scoped_ptr<const CandidateSessionConfig> candidate_config_;
177 SessionConfig config_; 177 SessionConfig config_;
178 MessageLoop* message_loop_; 178 MessageLoop* message_loop_;
179 179
180 std::map<std::string, FakeSocket*> stream_channels_; 180 std::map<std::string, FakeSocket*> stream_channels_;
181 std::map<std::string, FakeUdpSocket*> datagram_channels_; 181 std::map<std::string, FakeUdpSocket*> datagram_channels_;
182 182
183 std::string jid_; 183 std::string jid_;
184 184
185 Session::Error error_; 185 ErrorCode error_;
186 bool closed_; 186 bool closed_;
187 187
188 DISALLOW_COPY_AND_ASSIGN(FakeSession); 188 DISALLOW_COPY_AND_ASSIGN(FakeSession);
189 }; 189 };
190 190
191 } // namespace protocol 191 } // namespace protocol
192 } // namespace remoting 192 } // namespace remoting
193 193
194 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ 194 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_
OLDNEW
« no previous file with comments | « remoting/protocol/errors.h ('k') | remoting/protocol/fake_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698