summaryrefslogtreecommitdiff
path: root/chromium/extensions/common/mojo/stash.mojom
blob: 5c1e68bd169b62a86e7830c59eeadeb96ab07404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module extensions;

// A stashed client object. This contains the serialized bytes and handles,
// stored in |data| and |handles|, respectively, of a mojo struct of the
// serialized representation of the client object.
struct StashedObject {
  // A client identifier for this stashed object. This is to allow the client to
  // reconstitute the correct serialization struct from this StashedObject.
  string id;

  // The serialized data of the serialization struct.
  array<uint8> data;

  // The handles contained within the serialization struct.
  array<handle> stashed_handles;

  // Whether to monitor |stashed_handles| and relaunch the client when a handle
  // becomes readable.
  bool monitor_handles = false;
};

interface StashService {
  // Adds |stashed_objects| to the stash. StashedObjects are stored in memory in
  // the browser process for as long as the extension that owns them remains
  // enabled and the browser process runs.
  AddToStash(array<StashedObject> stashed_objects);

  // Returns all stashed objects.
  RetrieveStash() => (array<StashedObject> stash);
};