1// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5module sharing.mojom;
6
7import "chromeos/services/nearby/public/mojom/nearby_connections.mojom";
8import "chromeos/services/nearby/public/mojom/nearby_decoder.mojom";
9import "services/network/public/mojom/mdns_responder.mojom";
10import "services/network/public/mojom/p2p.mojom";
11
12// Interface for sharing related services. Lives in a sandboxed utility process
13// and is used by the browser process to offload unsafe protocol parsing.
14interface Sharing {
15  // Connects to Nearby functionality: Nearby Connections and the Nearby Share
16  // decoder. All dependencies should be provided via the |dependencies| struct.
17  // Shutdown of Nearby functionality is asynchronous; to shut down the process,
18  // call ShutDown() and wait for the operation to complete before disconnecting
19  // the Sharing Mojo connection.
20  Connect(
21      location.nearby.connections.mojom.NearbyConnectionsDependencies deps,
22      pending_receiver<
23          location.nearby.connections.mojom.NearbyConnections>
24              nearby_connections,
25      pending_receiver<sharing.mojom.NearbySharingDecoder>
26          decoder);
27
28  // Shuts down Nearby functionality; once this operation returns, it is safe to
29  // disconnect active Mojo connections.
30  ShutDown() => ();
31};
32