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

Unified Diff: remoting/protocol/session_config.cc

Issue 9240033: Use scoped_ptr<>.Pass() to pass ownership in the remoting protocol code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 11 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
Index: remoting/protocol/session_config.cc
diff --git a/remoting/protocol/session_config.cc b/remoting/protocol/session_config.cc
index c4a220ad04406ded0a82d77502b6aa3ab3f15d91..528d96c400268959a7ef07d54421c6b4287c9f81 100644
--- a/remoting/protocol/session_config.cc
+++ b/remoting/protocol/session_config.cc
@@ -126,28 +126,28 @@ bool CandidateSessionConfig::IsChannelConfigSupported(
return std::find(vector.begin(), vector.end(), value) != vector.end();
}
-CandidateSessionConfig* CandidateSessionConfig::Clone() const {
- return new CandidateSessionConfig(*this);
+scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::Clone() const {
+ return scoped_ptr<CandidateSessionConfig>(new CandidateSessionConfig(*this));
}
// static
-CandidateSessionConfig* CandidateSessionConfig::CreateEmpty() {
- return new CandidateSessionConfig();
+scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateEmpty() {
+ return scoped_ptr<CandidateSessionConfig>(new CandidateSessionConfig());
}
// static
-CandidateSessionConfig* CandidateSessionConfig::CreateFrom(
+scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateFrom(
const SessionConfig& config) {
- CandidateSessionConfig* result = CreateEmpty();
+ scoped_ptr<CandidateSessionConfig> result = CreateEmpty();
result->mutable_control_configs()->push_back(config.control_config());
result->mutable_event_configs()->push_back(config.event_config());
result->mutable_video_configs()->push_back(config.video_config());
- return result;
+ return result.Pass();
}
// static
-CandidateSessionConfig* CandidateSessionConfig::CreateDefault() {
- CandidateSessionConfig* result = CreateEmpty();
+scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() {
+ scoped_ptr<CandidateSessionConfig> result = CreateEmpty();
result->mutable_control_configs()->push_back(
ChannelConfig(ChannelConfig::TRANSPORT_STREAM,
kDefaultStreamVersion,
@@ -160,7 +160,7 @@ CandidateSessionConfig* CandidateSessionConfig::CreateDefault() {
ChannelConfig(ChannelConfig::TRANSPORT_STREAM,
kDefaultStreamVersion,
ChannelConfig::CODEC_VP8));
- return result;
+ return result.Pass();
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698