blob: 6e582ced4b2d37991796304cafb39eaa751b2156 [file] [log] [blame]
// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package consoleserver
import (
"context"
"go.chromium.org/infra/fleetconsole/api/fleetconsolerpc"
browserdevicedb "go.chromium.org/infra/fleetconsole/internal/database/browser_devicedb"
"go.chromium.org/infra/fleetconsole/internal/ufsclient"
)
func (frontend *FleetConsoleFrontend) CountBrowserDevices(ctx context.Context, req *fleetconsolerpc.CountBrowserDevicesRequest) (_ *fleetconsolerpc.CountBrowserDevicesResponse, err error) {
realms, err := ufsclient.GetUserRealms(ctx, frontend.cloudProject)
if err != nil {
return nil, err
}
return browserdevicedb.CountDevices(ctx, req.GetFilter(), realms)
}