Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/host/cast_extension_session.h" | 5 #include "remoting/host/cast_extension_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 std::string sdp_mid; | 382 std::string sdp_mid; |
| 383 int sdp_mlineindex = 0; | 383 int sdp_mlineindex = 0; |
| 384 if (!message_data->GetString(kWebRtcSDPMid, &sdp_mid) || | 384 if (!message_data->GetString(kWebRtcSDPMid, &sdp_mid) || |
| 385 !message_data->GetInteger(kWebRtcSDPMLineIndex, &sdp_mlineindex) || | 385 !message_data->GetInteger(kWebRtcSDPMLineIndex, &sdp_mlineindex) || |
| 386 !message_data->GetString(kWebRtcCandidate, &candidate_str)) { | 386 !message_data->GetString(kWebRtcCandidate, &candidate_str)) { |
| 387 LOG(ERROR) << "Invalid Cast Extension Message (could not parse)."; | 387 LOG(ERROR) << "Invalid Cast Extension Message (could not parse)."; |
| 388 return false; | 388 return false; |
| 389 } | 389 } |
| 390 | 390 |
| 391 rtc::scoped_ptr<webrtc::IceCandidateInterface> candidate( | 391 rtc::scoped_ptr<webrtc::IceCandidateInterface> candidate( |
| 392 webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, candidate_str)); | 392 webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, candidate_str, |
| 393 nullptr)); | |
|
Sergey Ulanov
2015/07/06 18:03:19
please fix indentation. This argument should be al
joachim
2015/07/07 08:52:20
Done.
| |
| 393 if (!candidate.get()) { | 394 if (!candidate.get()) { |
| 394 LOG(ERROR) | 395 LOG(ERROR) |
| 395 << "Invalid Cast Extension Message (could not create candidate)."; | 396 << "Invalid Cast Extension Message (could not create candidate)."; |
| 396 return false; | 397 return false; |
| 397 } | 398 } |
| 398 | 399 |
| 399 if (!peer_connection_->AddIceCandidate(candidate.get())) { | 400 if (!peer_connection_->AddIceCandidate(candidate.get())) { |
| 400 LOG(ERROR) << "Failed to apply received ICE Candidate to PeerConnection."; | 401 LOG(ERROR) << "Failed to apply received ICE Candidate to PeerConnection."; |
| 401 return false; | 402 return false; |
| 402 } | 403 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 json.SetString(kWebRtcCandidate, candidate_str); | 654 json.SetString(kWebRtcCandidate, candidate_str); |
| 654 std::string json_str; | 655 std::string json_str; |
| 655 if (!base::JSONWriter::Write(json, &json_str)) { | 656 if (!base::JSONWriter::Write(json, &json_str)) { |
| 656 LOG(ERROR) << "Failed to serialize candidate message."; | 657 LOG(ERROR) << "Failed to serialize candidate message."; |
| 657 return; | 658 return; |
| 658 } | 659 } |
| 659 SendMessageToClient(kSubjectNewCandidate, json_str); | 660 SendMessageToClient(kSubjectNewCandidate, json_str); |
| 660 } | 661 } |
| 661 | 662 |
| 662 } // namespace remoting | 663 } // namespace remoting |
| OLD | NEW |