Commit 6ad61ec6 authored by Ricky Liang's avatar Ricky Liang Committed by Commit Bot

[VideoCapture] chromeos: Reduce and consolidate IPC timeout to 1 second

On Chrome OS we have a 3 seconds timeout for UI shutdown.  If Chrome
fails to stop itself in 3 seconds when the ui.conf job requests it, a
fail safe mechanims would kill the Chrome processes with SIGABRT.

If we happen to be in the middle of updating the camera info through
Mojo IPC, the 3 seconds Mojo IPC timeout would cause ui.conf to kill
Chrome with SIGABRT.

Bug: 940623
Change-Id: I96e75b9af1dc2060a305a8835a2352683414d6b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1858024Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705493}
parent d8e2189c
......@@ -29,8 +29,7 @@ namespace media {
namespace {
const base::TimeDelta kEventWaitTimeoutMs =
base::TimeDelta::FromMilliseconds(3000);
const base::TimeDelta kEventWaitTimeoutSecs = base::TimeDelta::FromSeconds(1);
class LocalCameraClientObserver : public CameraClientObserver {
public:
......@@ -237,13 +236,12 @@ void CameraHalDelegate::GetDeviceDescriptors(
return;
}
if (!external_camera_info_updated_.TimedWait(
base::TimeDelta::FromSeconds(1))) {
if (!external_camera_info_updated_.TimedWait(kEventWaitTimeoutSecs)) {
LOG(ERROR) << "Failed to get camera info from all external cameras";
}
if (IsRunningOnVM() && IsVividLoaded()) {
has_camera_connected_.TimedWait(base::TimeDelta::FromSeconds(1));
has_camera_connected_.TimedWait(kEventWaitTimeoutSecs);
}
base::AutoLock info_lock(camera_info_lock_);
......@@ -393,7 +391,7 @@ bool CameraHalDelegate::UpdateBuiltInCameraInfo() {
FROM_HERE,
base::BindOnce(&CameraHalDelegate::UpdateBuiltInCameraInfoOnIpcThread,
this));
if (!builtin_camera_info_updated_.TimedWait(kEventWaitTimeoutMs)) {
if (!builtin_camera_info_updated_.TimedWait(kEventWaitTimeoutSecs)) {
LOG(ERROR) << "Timed out getting camera info";
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment