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/file_util.h" | 7 #include "base/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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 base::Bind(base::IgnoreResult(&base::DeleteFile), | 323 base::Bind(base::IgnoreResult(&base::DeleteFile), |
324 outgoing_dump_path_, | 324 outgoing_dump_path_, |
325 false)); | 325 false)); |
326 | 326 |
327 DVLOG(2) << "Deleted invalid outgoing dump " | 327 DVLOG(2) << "Deleted invalid outgoing dump " |
328 << outgoing_dump_path_.value(); | 328 << outgoing_dump_path_.value(); |
329 outgoing_dump_path_.clear(); | 329 outgoing_dump_path_.clear(); |
330 } | 330 } |
331 } | 331 } |
332 | 332 |
333 if (!callback.is_null()) | |
334 callback.Run(); | |
335 | |
336 // Release the writer when it's no longer needed. | 333 // Release the writer when it's no longer needed. |
337 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && | 334 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && |
338 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { | 335 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { |
339 dump_writer_.reset(); | 336 dump_writer_.reset(); |
340 --g_ongoing_rtp_dumps; | 337 --g_ongoing_rtp_dumps; |
341 } | 338 } |
| 339 |
| 340 // This object might be deleted after running the callback. |
| 341 if (!callback.is_null()) |
| 342 callback.Run(); |
342 } | 343 } |
OLD | NEW |