Commit 829f713b authored by Sergei Datsenko's avatar Sergei Datsenko Committed by Commit Bot

Add keepalive support to drivefs API

In some situations mounting drivefs may take very long time. To
distinguish it from a total hang we send periodic keepalives from drivefs.

BUG=chromium:899746

Change-Id: Iee906651557a8f8eab62d58298f33c7c3e61724e
Reviewed-on: https://chromium-review.googlesource.com/c/1305253
Commit-Queue: Sergei Datsenko <dats@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603732}
parent 6c9eba89
......@@ -281,6 +281,13 @@ class DriveFsHost::MountState
token_fetch_attempted_ = true;
}
void OnHeartbeat() override {
DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_);
if (host_->timer_->IsRunning()) {
host_->timer_->Reset();
}
}
void OnMounted() override {
DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_);
drivefs_has_mounted_ = true;
......
......@@ -95,6 +95,9 @@ interface DriveFsDelegate {
// Invoked whenever a Team Drive root changes or gets deleted.
OnTeamDriveChanged(string team_drive_id, CreateOrDelete change_type);
// Invoked from time to time to indicate that drivefs is operational.
OnHeartbeat();
};
struct DriveFsConfiguration {
......
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