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

Side by Side Diff: remoting/protocol/jingle_session_manager.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/jingle_session_manager.h" 5 #include "remoting/protocol/jingle_session_manager.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 // Always reject connection if there is no callback. 242 // Always reject connection if there is no callback.
243 IncomingSessionResponse response = protocol::SessionManager::DECLINE; 243 IncomingSessionResponse response = protocol::SessionManager::DECLINE;
244 244
245 // Use the callback to generate a response. 245 // Use the callback to generate a response.
246 listener_->OnIncomingSession(jingle_session, &response); 246 listener_->OnIncomingSession(jingle_session, &response);
247 247
248 switch (response) { 248 switch (response) {
249 case protocol::SessionManager::ACCEPT: { 249 case protocol::SessionManager::ACCEPT: {
250 // Connection must be configured by the callback. 250 // Connection must be configured by the callback.
251 DCHECK(jingle_session->config());
252 CandidateSessionConfig* candidate_config = 251 CandidateSessionConfig* candidate_config =
253 CandidateSessionConfig::CreateFrom(jingle_session->config()); 252 CandidateSessionConfig::CreateFrom(jingle_session->config());
254 cricket_session->Accept( 253 cricket_session->Accept(
255 CreateHostSessionDescription(candidate_config, 254 CreateHostSessionDescription(candidate_config,
256 jingle_session->local_certificate())); 255 jingle_session->local_certificate()));
257 break; 256 break;
258 } 257 }
259 258
260 case protocol::SessionManager::INCOMPATIBLE: { 259 case protocol::SessionManager::INCOMPATIBLE: {
261 cricket_session->Reject(cricket::STR_TERMINATE_INCOMPATIBLE_PARAMETERS); 260 cricket_session->Reject(cricket::STR_TERMINATE_INCOMPATIBLE_PARAMETERS);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 const std::string& certificate) { 348 const std::string& certificate) {
350 cricket::SessionDescription* desc = new cricket::SessionDescription(); 349 cricket::SessionDescription* desc = new cricket::SessionDescription();
351 desc->AddContent( 350 desc->AddContent(
352 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, 351 ContentDescription::kChromotingContentName, kChromotingXmlNamespace,
353 new ContentDescription(config, "", certificate)); 352 new ContentDescription(config, "", certificate));
354 return desc; 353 return desc;
355 } 354 }
356 355
357 } // namespace protocol 356 } // namespace protocol
358 } // namespace remoting 357 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698