| 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 "chrome/browser/media/webrtc_rtp_dump_writer.h" | 5 #include "chrome/browser/media/webrtc_rtp_dump_writer.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/big_endian.h" | 9 #include "base/big_endian.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 WebRtcRtpDumpWriter::EndDumpContext::EndDumpContext( | 342 WebRtcRtpDumpWriter::EndDumpContext::EndDumpContext( |
| 343 RtpDumpType type, | 343 RtpDumpType type, |
| 344 const EndDumpCallback& callback) | 344 const EndDumpCallback& callback) |
| 345 : type(type), | 345 : type(type), |
| 346 incoming_succeeded(false), | 346 incoming_succeeded(false), |
| 347 outgoing_succeeded(false), | 347 outgoing_succeeded(false), |
| 348 callback(callback) { | 348 callback(callback) { |
| 349 } | 349 } |
| 350 | 350 |
| 351 WebRtcRtpDumpWriter::EndDumpContext::EndDumpContext( |
| 352 const EndDumpContext& other) = default; |
| 353 |
| 351 WebRtcRtpDumpWriter::EndDumpContext::~EndDumpContext() { | 354 WebRtcRtpDumpWriter::EndDumpContext::~EndDumpContext() { |
| 352 } | 355 } |
| 353 | 356 |
| 354 void WebRtcRtpDumpWriter::FlushBuffer(bool incoming, | 357 void WebRtcRtpDumpWriter::FlushBuffer(bool incoming, |
| 355 bool end_stream, | 358 bool end_stream, |
| 356 const FlushDoneCallback& callback) { | 359 const FlushDoneCallback& callback) { |
| 357 DCHECK(thread_checker_.CalledOnValidThread()); | 360 DCHECK(thread_checker_.CalledOnValidThread()); |
| 358 | 361 |
| 359 scoped_ptr<std::vector<uint8_t>> new_buffer(new std::vector<uint8_t>()); | 362 scoped_ptr<std::vector<uint8_t>> new_buffer(new std::vector<uint8_t>()); |
| 360 | 363 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 base::Bind(&WebRtcRtpDumpWriter::OnDumpEnded, | 443 base::Bind(&WebRtcRtpDumpWriter::OnDumpEnded, |
| 441 weak_ptr_factory_.GetWeakPtr(), | 444 weak_ptr_factory_.GetWeakPtr(), |
| 442 context, | 445 context, |
| 443 false)); | 446 false)); |
| 444 return; | 447 return; |
| 445 } | 448 } |
| 446 | 449 |
| 447 // This object might be deleted after running the callback. | 450 // This object might be deleted after running the callback. |
| 448 context.callback.Run(context.incoming_succeeded, context.outgoing_succeeded); | 451 context.callback.Run(context.incoming_succeeded, context.outgoing_succeeded); |
| 449 } | 452 } |
| OLD | NEW |