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

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

Issue 8573013: Add CancelChannelCreation() in protocol::Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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_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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 void set_error(Session::Error error) { error_ = error; } 133 void set_error(Session::Error error) { error_ = error; }
134 134
135 bool is_closed() const { return closed_; } 135 bool is_closed() const { return closed_; }
136 136
137 FakeSocket* GetStreamChannel(const std::string& name); 137 FakeSocket* GetStreamChannel(const std::string& name);
138 FakeUdpSocket* GetDatagramChannel(const std::string& name); 138 FakeUdpSocket* GetDatagramChannel(const std::string& name);
139 139
140 // Session interface. 140 // Session interface.
141 virtual void SetStateChangeCallback(const StateChangeCallback& callback); 141 virtual void SetStateChangeCallback(
142 const StateChangeCallback& callback) OVERRIDE;
142 143
143 virtual Session::Error error(); 144 virtual Session::Error error() OVERRIDE;
144 145
145 virtual void CreateStreamChannel( 146 virtual void CreateStreamChannel(
146 const std::string& name, const StreamChannelCallback& callback); 147 const std::string& name, const StreamChannelCallback& callback) OVERRIDE;
147 virtual void CreateDatagramChannel( 148 virtual void CreateDatagramChannel(
148 const std::string& name, const DatagramChannelCallback& callback); 149 const std::string& name,
150 const DatagramChannelCallback& callback) OVERRIDE;
151 virtual void CancelChannelCreation(const std::string& name) OVERRIDE;
149 152
150 virtual FakeSocket* control_channel(); 153 virtual FakeSocket* control_channel() OVERRIDE;
151 virtual FakeSocket* event_channel(); 154 virtual FakeSocket* event_channel() OVERRIDE;
152 155
153 virtual const std::string& jid(); 156 virtual const std::string& jid() OVERRIDE;
154 157
155 virtual const CandidateSessionConfig* candidate_config(); 158 virtual const CandidateSessionConfig* candidate_config() OVERRIDE;
156 virtual const SessionConfig& config(); 159 virtual const SessionConfig& config() OVERRIDE;
157 virtual void set_config(const SessionConfig& config); 160 virtual void set_config(const SessionConfig& config) OVERRIDE;
158 161
159 virtual const std::string& initiator_token(); 162 virtual const std::string& initiator_token() OVERRIDE;
160 virtual void set_initiator_token(const std::string& initiator_token); 163 virtual void set_initiator_token(const std::string& initiator_token) OVERRIDE;
161 virtual const std::string& receiver_token(); 164 virtual const std::string& receiver_token() OVERRIDE;
162 virtual void set_receiver_token(const std::string& receiver_token); 165 virtual void set_receiver_token(const std::string& receiver_token) OVERRIDE;
163 166
164 virtual void set_shared_secret(const std::string& secret); 167 virtual void set_shared_secret(const std::string& secret) OVERRIDE;
165 virtual const std::string& shared_secret(); 168 virtual const std::string& shared_secret() OVERRIDE;
166 169
167 virtual void Close(); 170 virtual void Close() OVERRIDE;
Wez 2011/11/15 22:29:13 nit: These aren't related to this CL?
Sergey Ulanov 2011/11/16 00:01:33 CancelChannelCreation() is a new method in Session
168 171
169 public: 172 public:
170 StateChangeCallback callback_; 173 StateChangeCallback callback_;
171 scoped_ptr<const CandidateSessionConfig> candidate_config_; 174 scoped_ptr<const CandidateSessionConfig> candidate_config_;
172 SessionConfig config_; 175 SessionConfig config_;
173 MessageLoop* message_loop_; 176 MessageLoop* message_loop_;
174 FakeSocket control_channel_; 177 FakeSocket control_channel_;
175 FakeSocket event_channel_; 178 FakeSocket event_channel_;
176 179
177 std::map<std::string, FakeSocket*> stream_channels_; 180 std::map<std::string, FakeSocket*> stream_channels_;
178 std::map<std::string, FakeUdpSocket*> datagram_channels_; 181 std::map<std::string, FakeUdpSocket*> datagram_channels_;
179 182
180 std::string initiator_token_; 183 std::string initiator_token_;
181 std::string receiver_token_; 184 std::string receiver_token_;
182 185
183 std::string shared_secret_; 186 std::string shared_secret_;
184 187
185 std::string jid_; 188 std::string jid_;
186 189
187 Session::Error error_; 190 Session::Error error_;
188 bool closed_; 191 bool closed_;
189 192
190 DISALLOW_COPY_AND_ASSIGN(FakeSession); 193 DISALLOW_COPY_AND_ASSIGN(FakeSession);
191 }; 194 };
192 195
193 } // namespace protocol 196 } // namespace protocol
194 } // namespace remoting 197 } // namespace remoting
195 198
196 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ 199 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698