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 <utility> |
| 8 |
7 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
10 #include "base/time/time.h" | 12 #include "base/time/time.h" |
11 #include "chrome/browser/media/webrtc_rtp_dump_writer.h" | 13 #include "chrome/browser/media/webrtc_rtp_dump_writer.h" |
12 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
13 | 15 |
14 using content::BrowserThread; | 16 using content::BrowserThread; |
15 | 17 |
16 namespace { | 18 namespace { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 base::Bind(&WebRtcRtpDumpHandler::OnDumpEnded, | 267 base::Bind(&WebRtcRtpDumpHandler::OnDumpEnded, |
266 base::Unretained(this), | 268 base::Unretained(this), |
267 callback, | 269 callback, |
268 type)); | 270 type)); |
269 } | 271 } |
270 | 272 |
271 void WebRtcRtpDumpHandler::SetDumpWriterForTesting( | 273 void WebRtcRtpDumpHandler::SetDumpWriterForTesting( |
272 scoped_ptr<WebRtcRtpDumpWriter> writer) { | 274 scoped_ptr<WebRtcRtpDumpWriter> writer) { |
273 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 275 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
274 | 276 |
275 dump_writer_ = writer.Pass(); | 277 dump_writer_ = std::move(writer); |
276 ++g_ongoing_rtp_dumps; | 278 ++g_ongoing_rtp_dumps; |
277 | 279 |
278 incoming_dump_path_ = dump_dir_.AppendASCII("recv"); | 280 incoming_dump_path_ = dump_dir_.AppendASCII("recv"); |
279 outgoing_dump_path_ = dump_dir_.AppendASCII("send"); | 281 outgoing_dump_path_ = dump_dir_.AppendASCII("send"); |
280 } | 282 } |
281 | 283 |
282 void WebRtcRtpDumpHandler::OnMaxDumpSizeReached() { | 284 void WebRtcRtpDumpHandler::OnMaxDumpSizeReached() { |
283 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 285 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
284 | 286 |
285 RtpDumpType type = | 287 RtpDumpType type = |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && | 336 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && |
335 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { | 337 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { |
336 dump_writer_.reset(); | 338 dump_writer_.reset(); |
337 --g_ongoing_rtp_dumps; | 339 --g_ongoing_rtp_dumps; |
338 } | 340 } |
339 | 341 |
340 // This object might be deleted after running the callback. | 342 // This object might be deleted after running the callback. |
341 if (!callback.is_null()) | 343 if (!callback.is_null()) |
342 callback.Run(); | 344 callback.Run(); |
343 } | 345 } |
OLD | NEW |