Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/webrtc_transport.h" | 5 #include "remoting/protocol/webrtc_transport.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 std::string description_sdp; | 465 std::string description_sdp; |
| 466 if (!description->ToString(&description_sdp)) { | 466 if (!description->ToString(&description_sdp)) { |
| 467 LOG(ERROR) << "Failed to serialize description."; | 467 LOG(ERROR) << "Failed to serialize description."; |
| 468 Close(CHANNEL_CONNECTION_ERROR); | 468 Close(CHANNEL_CONNECTION_ERROR); |
| 469 return; | 469 return; |
| 470 } | 470 } |
| 471 | 471 |
| 472 SdpMessage sdp_message(description_sdp); | 472 SdpMessage sdp_message(description_sdp); |
| 473 UpdateCodecParameters(&sdp_message, /*incoming=*/false); | 473 UpdateCodecParameters(&sdp_message, /*incoming=*/false); |
| 474 description_sdp = sdp_message.ToString(); | 474 description_sdp = sdp_message.ToString(); |
| 475 { | |
|
Sergey Ulanov
2017/02/21 18:47:03
remove these braces, I don't think they add anythi
| |
| 476 webrtc::SdpParseError err; | |
|
Sergey Ulanov
2017/02/21 18:47:03
s/err/error/
kwiberg-chromium
2017/02/21 21:32:41
There's already a function argument called error--
Sergey Ulanov
2017/02/21 21:49:27
Maybe call it parse_error?
If you keep the braces
kwiberg-chromium
2017/02/21 21:56:54
Yes. We *need* to have the braces *or* a variable
Sergey Ulanov
2017/02/21 22:31:52
Sorry I didn't pay full attention to what you wrot
kwiberg-chromium
2017/02/21 23:03:31
I'll go with your preference since this is your co
| |
| 477 description.reset(webrtc::CreateSessionDescription(description->type(), | |
| 478 description_sdp, &err)); | |
| 479 if (!description) { | |
| 480 LOG(ERROR) << "Failed to parse the session description: " | |
| 481 << err.description << " line: " << err.line; | |
| 482 Close(CHANNEL_CONNECTION_ERROR); | |
| 483 return; | |
| 484 } | |
| 485 } | |
| 475 | 486 |
| 476 // Format and send the session description to the peer. | 487 // Format and send the session description to the peer. |
| 477 std::unique_ptr<XmlElement> transport_info( | 488 std::unique_ptr<XmlElement> transport_info( |
| 478 new XmlElement(QName(kTransportNamespace, "transport"), true)); | 489 new XmlElement(QName(kTransportNamespace, "transport"), true)); |
| 479 XmlElement* offer_tag = | 490 XmlElement* offer_tag = |
| 480 new XmlElement(QName(kTransportNamespace, "session-description")); | 491 new XmlElement(QName(kTransportNamespace, "session-description")); |
| 481 transport_info->AddElement(offer_tag); | 492 transport_info->AddElement(offer_tag); |
| 482 offer_tag->SetAttr(QName(std::string(), "type"), description->type()); | 493 offer_tag->SetAttr(QName(std::string(), "type"), description->type()); |
| 483 offer_tag->SetBodyText(description_sdp); | 494 offer_tag->SetBodyText(description_sdp); |
| 484 | 495 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 // the stack and so it must be destroyed later. | 713 // the stack and so it must be destroyed later. |
| 703 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( | 714 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( |
| 704 FROM_HERE, peer_connection_wrapper_.release()); | 715 FROM_HERE, peer_connection_wrapper_.release()); |
| 705 | 716 |
| 706 if (error != OK) | 717 if (error != OK) |
| 707 event_handler_->OnWebrtcTransportError(error); | 718 event_handler_->OnWebrtcTransportError(error); |
| 708 } | 719 } |
| 709 | 720 |
| 710 } // namespace protocol | 721 } // namespace protocol |
| 711 } // namespace remoting | 722 } // namespace remoting |
| OLD | NEW |