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

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

Issue 7796026: Pass SessionConfig by reference instead of pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 #include "remoting/protocol/fake_session.h" 5 #include "remoting/protocol/fake_session.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 NOTIMPLEMENTED(); 196 NOTIMPLEMENTED();
197 return false; 197 return false;
198 } 198 }
199 bool FakeUdpSocket::SetSendBufferSize(int32 size) { 199 bool FakeUdpSocket::SetSendBufferSize(int32 size) {
200 NOTIMPLEMENTED(); 200 NOTIMPLEMENTED();
201 return false; 201 return false;
202 } 202 }
203 203
204 FakeSession::FakeSession() 204 FakeSession::FakeSession()
205 : candidate_config_(CandidateSessionConfig::CreateDefault()), 205 : candidate_config_(CandidateSessionConfig::CreateDefault()),
206 config_(SessionConfig::CreateDefault()), 206 config_(SessionConfig::GetDefault()),
207 message_loop_(NULL), 207 message_loop_(NULL),
208 jid_(kTestJid) { 208 jid_(kTestJid) {
209 } 209 }
210 210
211 FakeSession::~FakeSession() { } 211 FakeSession::~FakeSession() { }
212 212
213 FakeSocket* FakeSession::GetStreamChannel(const std::string& name) { 213 FakeSocket* FakeSession::GetStreamChannel(const std::string& name) {
214 return stream_channels_[name]; 214 return stream_channels_[name];
215 } 215 }
216 216
(...skipping 28 matching lines...) Expand all
245 } 245 }
246 246
247 const std::string& FakeSession::jid() { 247 const std::string& FakeSession::jid() {
248 return jid_; 248 return jid_;
249 } 249 }
250 250
251 const CandidateSessionConfig* FakeSession::candidate_config() { 251 const CandidateSessionConfig* FakeSession::candidate_config() {
252 return candidate_config_.get(); 252 return candidate_config_.get();
253 } 253 }
254 254
255 const SessionConfig* FakeSession::config() { 255 const SessionConfig& FakeSession::config() {
256 CHECK(config_.get()); 256 return config_;
257 return config_.get();
258 } 257 }
259 258
260 void FakeSession::set_config(const SessionConfig* config) { 259 void FakeSession::set_config(const SessionConfig& config) {
261 config_.reset(config); 260 config_ = config;
262 } 261 }
263 262
264 const std::string& FakeSession::initiator_token() { 263 const std::string& FakeSession::initiator_token() {
265 return initiator_token_; 264 return initiator_token_;
266 } 265 }
267 266
268 void FakeSession::set_initiator_token(const std::string& initiator_token) { 267 void FakeSession::set_initiator_token(const std::string& initiator_token) {
269 initiator_token_ = initiator_token; 268 initiator_token_ = initiator_token;
270 } 269 }
271 270
(...skipping 12 matching lines...) Expand all
284 const std::string& FakeSession::shared_secret() { 283 const std::string& FakeSession::shared_secret() {
285 return shared_secret_; 284 return shared_secret_;
286 } 285 }
287 286
288 void FakeSession::Close() { 287 void FakeSession::Close() {
289 closed_ = true; 288 closed_ = true;
290 } 289 }
291 290
292 } // namespace protocol 291 } // namespace protocol
293 } // namespace remoting 292 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698