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

Unified Diff: remoting/host/chromoting_host.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 86ba1c0739019ae5bacb3aeb59731523b78dcc08..8947a27f51c3bdd00a42e2c5e59bd0dc5bb2b1ea 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -277,10 +277,9 @@ void ChromotingHost::OnIncomingSession(
*protocol_config_->mutable_initial_resolution() =
protocol::ScreenResolution(2048, 2048);
// TODO(sergeyu): Respect resolution requested by the client if supported.
- protocol::SessionConfig* config = protocol_config_->Select(
- session->candidate_config(), true /* force_host_resolution */);
-
- if (!config) {
+ protocol::SessionConfig config;
+ if (!protocol_config_->Select(session->candidate_config(),
+ true /* force_host_resolution */, &config)) {
LOG(WARNING) << "Rejecting connection from " << session->jid()
<< " because no compatible configuration has been found.";
*response = protocol::SessionManager::INCOMPATIBLE;
@@ -406,8 +405,8 @@ void ChromotingHost::OnClientDisconnected(ConnectionToClient* connection) {
}
// TODO(sergeyu): Move this to SessionManager?
-Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig* config) {
- const protocol::ChannelConfig& video_config = config->video_config();
+Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig& config) {
+ const protocol::ChannelConfig& video_config = config.video_config();
if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
return EncoderRowBased::CreateVerbatimEncoder();
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698