Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1139)

Unified Diff: content/browser/renderer_host/media/video_capture_device_impl.cc

Issue 140633004: Reland CL to implement browser-side logging to WebRtc log. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: These are the changes that should fix crbug.com/338848 Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/video_capture_device_impl.cc
diff --git a/content/browser/renderer_host/media/video_capture_device_impl.cc b/content/browser/renderer_host/media/video_capture_device_impl.cc
index 045eda6092d0608c640ccf57bb4d4b9489356617..88e5ab5927ed0d342d2cd857e877ff9955a59e20 100644
--- a/content/browser/renderer_host/media/video_capture_device_impl.cc
+++ b/content/browser/renderer_host/media/video_capture_device_impl.cc
@@ -155,10 +155,10 @@ void ThreadSafeCaptureOracle::Stop() {
client_.reset();
}
-void ThreadSafeCaptureOracle::ReportError() {
+void ThreadSafeCaptureOracle::ReportError(const std::string& reason) {
base::AutoLock guard(lock_);
if (client_)
- client_->OnError();
+ client_->OnError(reason);
}
void ThreadSafeCaptureOracle::DidCaptureFrame(
@@ -196,16 +196,19 @@ void VideoCaptureDeviceImpl::AllocateAndStart(
}
if (params.requested_format.frame_rate <= 0) {
- DVLOG(1) << "invalid frame_rate: " << params.requested_format.frame_rate;
- client->OnError();
+ std::string error_msg = base::StringPrintf(
+ "invalid frame_rate: %d", params.requested_format.frame_rate);
+ DVLOG(1) << error_msg;
+ client->OnError(error_msg);
return;
}
if (params.requested_format.frame_size.width() < kMinFrameWidth ||
params.requested_format.frame_size.height() < kMinFrameHeight) {
- DVLOG(1) << "invalid frame size: "
- << params.requested_format.frame_size.ToString();
- client->OnError();
+ std::string error_msg =
+ "invalid frame size: " + params.requested_format.frame_size.ToString();
+ DVLOG(1) << error_msg;
+ client->OnError(error_msg);
return;
}
@@ -252,8 +255,9 @@ void VideoCaptureDeviceImpl::StopAndDeAllocate() {
void VideoCaptureDeviceImpl::CaptureStarted(bool success) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!success) {
- DVLOG(1) << "Failed to start capture machine.";
- Error();
+ std::string reason("Failed to start capture machine.");
+ DVLOG(1) << reason;
+ Error(reason);
}
}
@@ -291,14 +295,14 @@ void VideoCaptureDeviceImpl::TransitionStateTo(State next_state) {
state_ = next_state;
}
-void VideoCaptureDeviceImpl::Error() {
+void VideoCaptureDeviceImpl::Error(const std::string& reason) {
DCHECK(thread_checker_.CalledOnValidThread());
if (state_ == kIdle)
return;
if (oracle_proxy_)
- oracle_proxy_->ReportError();
+ oracle_proxy_->ReportError(reason);
StopAndDeAllocate();
TransitionStateTo(kError);

Powered by Google App Engine
This is Rietveld 408576698