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

Unified Diff: remoting/host/cast_extension_session.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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/client/plugin/chromoting_instance.cc ('k') | remoting/host/gnubby_auth_handler_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/cast_extension_session.cc
diff --git a/remoting/host/cast_extension_session.cc b/remoting/host/cast_extension_session.cc
index 9bceaa6e40b444fc9645b6246fc8ba911b85d0b1..843a79d1585d959e63c3ec6308babfbda70c6750 100644
--- a/remoting/host/cast_extension_session.cc
+++ b/remoting/host/cast_extension_session.cc
@@ -202,15 +202,15 @@ void CastExtensionSession::OnCreateSessionDescription(
peer_connection_->SetLocalDescription(
CastSetSessionDescriptionObserver::Create(), desc);
- scoped_ptr<base::DictionaryValue> json(new base::DictionaryValue());
- json->SetString(kWebRtcSessionDescType, desc->type());
+ base::DictionaryValue json;
+ json.SetString(kWebRtcSessionDescType, desc->type());
std::string subject =
(desc->type() == "offer") ? kSubjectOffer : kSubjectAnswer;
std::string desc_str;
desc->ToString(&desc_str);
- json->SetString(kWebRtcSessionDescSDP, desc_str);
+ json.SetString(kWebRtcSessionDescSDP, desc_str);
std::string json_str;
- if (!base::JSONWriter::Write(json.get(), &json_str)) {
+ if (!base::JSONWriter::Write(json, &json_str)) {
LOG(ERROR) << "Failed to serialize sdp message.";
return;
}
@@ -420,7 +420,7 @@ bool CastExtensionSession::SendMessageToClient(const std::string& subject,
message_dict.SetString(kTopLevelData, data);
std::string message_json;
- if (!base::JSONWriter::Write(&message_dict, &message_json)) {
+ if (!base::JSONWriter::Write(message_dict, &message_json)) {
LOG(ERROR) << "Failed to serialize JSON message.";
return false;
}
@@ -647,12 +647,12 @@ void CastExtensionSession::OnIceCandidate(
LOG(ERROR) << "PeerConnectionObserver: failed to serialize candidate.";
return;
}
- scoped_ptr<base::DictionaryValue> json(new base::DictionaryValue());
- json->SetString(kWebRtcSDPMid, candidate->sdp_mid());
- json->SetInteger(kWebRtcSDPMLineIndex, candidate->sdp_mline_index());
- json->SetString(kWebRtcCandidate, candidate_str);
+ base::DictionaryValue json;
+ json.SetString(kWebRtcSDPMid, candidate->sdp_mid());
+ json.SetInteger(kWebRtcSDPMLineIndex, candidate->sdp_mline_index());
+ json.SetString(kWebRtcCandidate, candidate_str);
std::string json_str;
- if (!base::JSONWriter::Write(json.get(), &json_str)) {
+ if (!base::JSONWriter::Write(json, &json_str)) {
LOG(ERROR) << "Failed to serialize candidate message.";
return;
}
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/host/gnubby_auth_handler_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698