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

Side by Side Diff: remoting/protocol/rtcp_writer.cc

Issue 7218061: Close all writers before JingleSession is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/rtcp_writer.h ('k') | remoting/protocol/rtp_video_reader_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/rtcp_writer.h" 5 #include "remoting/protocol/rtcp_writer.h"
6 6
7 #include "net/base/io_buffer.h" 7 #include "net/base/io_buffer.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "remoting/base/compound_buffer.h" 9 #include "remoting/base/compound_buffer.h"
10 #include "remoting/protocol/buffered_socket_writer.h" 10 #include "remoting/protocol/buffered_socket_writer.h"
11 #include "remoting/protocol/rtp_utils.h" 11 #include "remoting/protocol/rtp_utils.h"
12 12
13 namespace remoting { 13 namespace remoting {
14 namespace protocol { 14 namespace protocol {
15 15
16 RtcpWriter::RtcpWriter() { 16 RtcpWriter::RtcpWriter() {
17 } 17 }
18 18
19 RtcpWriter::~RtcpWriter() { } 19 RtcpWriter::~RtcpWriter() {
20 }
21
22 void RtcpWriter::Close() {
23 buffered_rtcp_writer_->Close();
24 }
20 25
21 // Initializes the writer. Must be called on the thread the sockets 26 // Initializes the writer. Must be called on the thread the sockets
22 // belong to. 27 // belong to.
23 void RtcpWriter::Init(net::Socket* socket) { 28 void RtcpWriter::Init(net::Socket* socket) {
24 buffered_rtcp_writer_ = new BufferedDatagramWriter(); 29 buffered_rtcp_writer_ = new BufferedDatagramWriter();
25 buffered_rtcp_writer_->Init(socket, NULL); 30 buffered_rtcp_writer_->Init(socket, NULL);
26 } 31 }
27 32
28 void RtcpWriter::SendReport(const RtcpReceiverReport& report) { 33 void RtcpWriter::SendReport(const RtcpReceiverReport& report) {
29 int size = GetRtcpReceiverReportSize(report); 34 int size = GetRtcpReceiverReportSize(report);
30 net::IOBufferWithSize* buffer = new net::IOBufferWithSize(size); 35 net::IOBufferWithSize* buffer = new net::IOBufferWithSize(size);
31 36
32 PackRtcpReceiverReport(report, reinterpret_cast<uint8*>(buffer->data()), 37 PackRtcpReceiverReport(report, reinterpret_cast<uint8*>(buffer->data()),
33 size); 38 size);
34 39
35 buffered_rtcp_writer_->Write(buffer, NULL); 40 buffered_rtcp_writer_->Write(buffer, NULL);
36 } 41 }
37 42
38 } // namespace protocol 43 } // namespace protocol
39 } // namespace remoting 44 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rtcp_writer.h ('k') | remoting/protocol/rtp_video_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698