Chromium Code Reviews| 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 host->StartRtpDump(params->incoming, params->outgoing); | |
|
Henrik Grunell
2014/05/14 12:14:12
Can this fail? Does it need to finish before we se
jiayl
2014/05/14 16:07:58
It cannot fail and we do not need to block the cal
Henrik Grunell
2014/05/15 14:36:34
OK.
| |
| 302 | |
| 301 return true; | 303 return true; |
| 302 } | 304 } |
| 303 | 305 |
| 304 void WebrtcLoggingPrivateStartRtpDumpFunction::StartRtpDumpCallback( | 306 void WebrtcLoggingPrivateStartRtpDumpFunction::StartRtpDumpCallback( |
| 305 bool success, | 307 bool success, |
| 306 const std::string& error_message) { | 308 const std::string& error_message) { |
| 307 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 309 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 308 if (!success) | 310 if (!success) |
| 309 SetError(error_message); | 311 SetError(error_message); |
| 310 SendResponse(success); | 312 SendResponse(success); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 332 &WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback, this); | 334 &WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback, this); |
| 333 | 335 |
| 334 BrowserThread::PostTask(BrowserThread::IO, | 336 BrowserThread::PostTask(BrowserThread::IO, |
| 335 FROM_HERE, | 337 FROM_HERE, |
| 336 base::Bind(&WebRtcLoggingHandlerHost::StopRtpDump, | 338 base::Bind(&WebRtcLoggingHandlerHost::StopRtpDump, |
| 337 webrtc_logging_handler_host, | 339 webrtc_logging_handler_host, |
| 338 params->incoming, | 340 params->incoming, |
| 339 params->outgoing, | 341 params->outgoing, |
| 340 callback)); | 342 callback)); |
| 341 | 343 |
| 344 host->StopRtpDump(params->incoming, params->outgoing); | |
| 345 | |
| 342 return true; | 346 return true; |
| 343 } | 347 } |
| 344 | 348 |
| 345 void WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback( | 349 void WebrtcLoggingPrivateStopRtpDumpFunction::StopRtpDumpCallback( |
| 346 bool success, | 350 bool success, |
| 347 const std::string& error_message) { | 351 const std::string& error_message) { |
| 348 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 352 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 349 if (!success) | 353 if (!success) |
| 350 SetError(error_message); | 354 SetError(error_message); |
| 351 SendResponse(success); | 355 SendResponse(success); |
| 352 } | 356 } |
| 353 | 357 |
| 354 } // namespace extensions | 358 } // namespace extensions |
| OLD | NEW |