aboutsummaryrefslogtreecommitdiff
path: root/cast/cast_core/api/web/message_channel.proto
blob: dc59b13b776e188100ad16735dd9823c0a57e0b8 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2021 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.
//
// **** DO NOT EDIT - this file was automatically generated. ****
syntax = "proto3";

package cast.web;

option optimize_for = LITE_RUNTIME;

message Message {
  oneof message_type {
    MessageRequest request = 1;
    MessageResponse response = 2;
    MessagePortStatus status = 3;
  }

  MessageChannelDescriptor channel = 4;
}

message MessageChannelDescriptor {
  uint32 channel_id = 1;
}

message MessageRequest {
  string data = 1;
  repeated MessagePortDescriptor ports = 2;
}

message MessageResponse {
  bool result = 1;
}

// MessagePortDescriptor is used to transfer ownership of a port across the
// MessageChannel. After port transfer, Messages may be sent to and from the
// port by using same |channel|, which must be unique to each entangled
// port pair. Pairs from Cast Core start with |channel_id| of 0x80000000 and
// increment by one for each pair; pairs generated by a runtime should start
// at 0x0 and increment by one to avoid collisions.
message MessagePortDescriptor {
  MessageChannelDescriptor channel = 1;
  MessagePortStatus peer_status = 2;
  uint32 sequence_number = 3;
}

message MessagePortStatus {
  enum Status {
    OK = 0;
    ERROR = 1;
    STARTED = 2;
  }

  Status status = 1;
}