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 <string> | 5 #include <string> |
6 | 6 |
7 #include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_pr
ivate_api.h" | 7 #include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_pr
ivate_api.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 &WebrtcLoggingPrivateStartRtpDumpFunction::StartRtpDumpCallback, this); | 291 &WebrtcLoggingPrivateStartRtpDumpFunction::StartRtpDumpCallback, this); |
292 | 292 |
293 BrowserThread::PostTask(BrowserThread::IO, | 293 BrowserThread::PostTask(BrowserThread::IO, |
294 FROM_HERE, | 294 FROM_HERE, |
295 base::Bind(&WebRtcLoggingHandlerHost::StartRtpDump, | 295 base::Bind(&WebRtcLoggingHandlerHost::StartRtpDump, |
296 webrtc_logging_handler_host, | 296 webrtc_logging_handler_host, |
297 params->incoming, | 297 params->incoming, |
298 params->outgoing, | 298 params->outgoing, |
299 callback)); | 299 callback)); |
300 | 300 |
| 301 // This call cannot fail and we do not need to block the callback for it. |
| 302 host->StartRtpDump(params->incoming, params->outgoing); |
| 303 |
301 return true; | 304 return true; |
302 } | 305 } |
303 | 306 |
304 void WebrtcLoggingPrivateStartRtpDumpFunction::StartRtpDumpCallback( | 307 void WebrtcLoggingPrivateStartRtpDumpFunction::StartRtpDumpCallback( |
305 bool success, | 308 bool success, |
306 const std::string& error_message) { | 309 const std::string& error_message) { |
307 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 310 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
308 if (!success) | 311 if (!success) |
309 SetError(error_message); | 312 SetError(error_message); |
310 SendResponse(success); | 313 SendResponse(success); |
(...skipping 21 matching lines...) Expand all Loading... |
332 &WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback, this); | 335 &WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback, this); |
333 | 336 |
334 BrowserThread::PostTask(BrowserThread::IO, | 337 BrowserThread::PostTask(BrowserThread::IO, |
335 FROM_HERE, | 338 FROM_HERE, |
336 base::Bind(&WebRtcLoggingHandlerHost::StopRtpDump, | 339 base::Bind(&WebRtcLoggingHandlerHost::StopRtpDump, |
337 webrtc_logging_handler_host, | 340 webrtc_logging_handler_host, |
338 params->incoming, | 341 params->incoming, |
339 params->outgoing, | 342 params->outgoing, |
340 callback)); | 343 callback)); |
341 | 344 |
| 345 // This call cannot fail and we do not need to block the callback for it. |
| 346 host->StopRtpDump(params->incoming, params->outgoing); |
| 347 |
342 return true; | 348 return true; |
343 } | 349 } |
344 | 350 |
345 void WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback( | 351 void WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback( |
346 bool success, | 352 bool success, |
347 const std::string& error_message) { | 353 const std::string& error_message) { |
348 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 354 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
349 if (!success) | 355 if (!success) |
350 SetError(error_message); | 356 SetError(error_message); |
351 SendResponse(success); | 357 SendResponse(success); |
352 } | 358 } |
353 | 359 |
354 } // namespace extensions | 360 } // namespace extensions |
OLD | NEW |