chromium/services/shape_detection/public/mojom/shape_detection_service.mojom

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module shape_detection.mojom;

import "sandbox/policy/mojom/sandbox.mojom";
import "services/shape_detection/public/mojom/barcodedetection_provider.mojom";
import "services/shape_detection/public/mojom/facedetection_provider.mojom";
import "services/shape_detection/public/mojom/textdetection.mojom";

[EnableIf=has_shape_detection_utility]
const sandbox.mojom.Sandbox kShapeDetectionSandbox = sandbox.mojom.Sandbox.kUtility;
[EnableIfNot=has_shape_detection_utility]
const sandbox.mojom.Sandbox kShapeDetectionSandbox = sandbox.mojom.Sandbox.kGpu;

// The main interface to the Shape Detection service. On ChromeOS Ash this is
// launched as a service and runs in a utility process, but is otherwise bound
// in the existing GPU process.
[ServiceSandbox=kShapeDetectionSandbox]
interface ShapeDetectionService {
  // Binds an endpoint which can be used to detect barcodes in images.
  BindBarcodeDetectionProvider(
      pending_receiver<BarcodeDetectionProvider> receiver);

  // Binds an endpoint which can be used to detect faces in images.
  BindFaceDetectionProvider(pending_receiver<FaceDetectionProvider> receiver);

  // Binds an endpoint which can be used to detect text in images.
  BindTextDetection(pending_receiver<TextDetection> receiver);
};