| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/media/webrtc_logging_handler_host.h" | 5 #include "chrome/browser/media/webrtc_logging_handler_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 BrowserThread::UI, | 274 BrowserThread::UI, |
| 275 FROM_HERE, | 275 FROM_HERE, |
| 276 base::Bind(stop_rtp_dump_callback_, | 276 base::Bind(stop_rtp_dump_callback_, |
| 277 type == RTP_DUMP_INCOMING || type == RTP_DUMP_BOTH, | 277 type == RTP_DUMP_INCOMING || type == RTP_DUMP_BOTH, |
| 278 type == RTP_DUMP_OUTGOING || type == RTP_DUMP_BOTH)); | 278 type == RTP_DUMP_OUTGOING || type == RTP_DUMP_BOTH)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 rtp_dump_handler_->StopDump(type, callback); | 281 rtp_dump_handler_->StopDump(type, callback); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void WebRtcLoggingHandlerHost::OnRtpPacket(const uint8* packet_header, | 284 void WebRtcLoggingHandlerHost::OnRtpPacket(scoped_ptr<uint8[]> packet_header, |
| 285 size_t header_length, | 285 size_t header_length, |
| 286 size_t packet_length, | 286 size_t packet_length, |
| 287 bool incoming) { | 287 bool incoming) { |
| 288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 289 | 289 |
| 290 scoped_ptr<uint8[]> header_data(new uint8[header_length]); | |
| 291 memcpy(header_data.get(), packet_header, header_length); | |
| 292 | |
| 293 BrowserThread::PostTask( | 290 BrowserThread::PostTask( |
| 294 BrowserThread::IO, | 291 BrowserThread::IO, |
| 295 FROM_HERE, | 292 FROM_HERE, |
| 296 base::Bind(&WebRtcLoggingHandlerHost::DumpRtpPacketOnIOThread, | 293 base::Bind(&WebRtcLoggingHandlerHost::DumpRtpPacketOnIOThread, |
| 297 this, | 294 this, |
| 298 base::Passed(&header_data), | 295 base::Passed(&packet_header), |
| 299 header_length, | 296 header_length, |
| 300 packet_length, | 297 packet_length, |
| 301 incoming)); | 298 incoming)); |
| 302 } | 299 } |
| 303 | 300 |
| 304 void WebRtcLoggingHandlerHost::DumpRtpPacketOnIOThread( | 301 void WebRtcLoggingHandlerHost::DumpRtpPacketOnIOThread( |
| 305 scoped_ptr<uint8[]> packet_header, | 302 scoped_ptr<uint8[]> packet_header, |
| 306 size_t header_length, | 303 size_t header_length, |
| 307 size_t packet_length, | 304 size_t packet_length, |
| 308 bool incoming) { | 305 bool incoming) { |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 void WebRtcLoggingHandlerHost::DoStartRtpDump(RtpDumpType type, | 609 void WebRtcLoggingHandlerHost::DoStartRtpDump(RtpDumpType type, |
| 613 GenericDoneCallback* callback) { | 610 GenericDoneCallback* callback) { |
| 614 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 611 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 615 DCHECK(rtp_dump_handler_); | 612 DCHECK(rtp_dump_handler_); |
| 616 | 613 |
| 617 std::string error; | 614 std::string error; |
| 618 | 615 |
| 619 bool result = rtp_dump_handler_->StartDump(type, &error); | 616 bool result = rtp_dump_handler_->StartDump(type, &error); |
| 620 FireGenericDoneCallback(callback, result, error); | 617 FireGenericDoneCallback(callback, result, error); |
| 621 } | 618 } |
| OLD | NEW |