| 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_handler.h" | 5 #include "chrome/browser/media/webrtc_rtp_dump_handler.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 if (outgoing_state_ == STATE_STOPPED) { | 201 if (outgoing_state_ == STATE_STOPPED) { |
| 202 DVLOG(2) << "Outgoing RTP dumps released: " << outgoing_dump_path_.value(); | 202 DVLOG(2) << "Outgoing RTP dumps released: " << outgoing_dump_path_.value(); |
| 203 | 203 |
| 204 outgoing_state_ = STATE_NONE; | 204 outgoing_state_ = STATE_NONE; |
| 205 outgoing_dump = outgoing_dump_path_; | 205 outgoing_dump = outgoing_dump_path_; |
| 206 } | 206 } |
| 207 return ReleasedDumps(incoming_dump, outgoing_dump); | 207 return ReleasedDumps(incoming_dump, outgoing_dump); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void WebRtcRtpDumpHandler::OnRtpPacket(const uint8* packet_header, | 210 void WebRtcRtpDumpHandler::OnRtpPacket(const uint8_t* packet_header, |
| 211 size_t header_length, | 211 size_t header_length, |
| 212 size_t packet_length, | 212 size_t packet_length, |
| 213 bool incoming) { | 213 bool incoming) { |
| 214 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 214 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 215 | 215 |
| 216 if ((incoming && incoming_state_ != STATE_STARTED) || | 216 if ((incoming && incoming_state_ != STATE_STARTED) || |
| 217 (!incoming && outgoing_state_ != STATE_STARTED)) { | 217 (!incoming && outgoing_state_ != STATE_STARTED)) { |
| 218 return; | 218 return; |
| 219 } | 219 } |
| 220 | 220 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && | 334 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && |
| 335 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { | 335 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { |
| 336 dump_writer_.reset(); | 336 dump_writer_.reset(); |
| 337 --g_ongoing_rtp_dumps; | 337 --g_ongoing_rtp_dumps; |
| 338 } | 338 } |
| 339 | 339 |
| 340 // This object might be deleted after running the callback. | 340 // This object might be deleted after running the callback. |
| 341 if (!callback.is_null()) | 341 if (!callback.is_null()) |
| 342 callback.Run(); | 342 callback.Run(); |
| 343 } | 343 } |
| OLD | NEW |