summaryrefslogtreecommitdiffstats
path: root/ipc/ipdl/ipdl/builtin.py
blob: b1bab64af859ba12abbde604f6e029dfc03e503b (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# WARNING: the syntax of the builtin types is not checked, so please
# don't add something syntactically invalid.  It will not be fun to
# track down the bug.

# C types
# These types don't live in any namespace, so can't be imported with `using`
# statements like normal C++ types.
CTypes = (
    "bool",
    "char",
    "short",
    "int",
    "long",
    "float",
    "double",
)

# C++ types
# These types must be fully qualified, and will be `typedef`-ed into IPDL
# structs to make them readily available when used.
Types = (
    # stdint types
    "int8_t",
    "uint8_t",
    "int16_t",
    "uint16_t",
    "int32_t",
    "uint32_t",
    "int64_t",
    "uint64_t",
    "intptr_t",
    "uintptr_t",
    # You may be tempted to add size_t. Do not! See bug 1525199.
    # Mozilla types: "less" standard things we know how serialize/deserialize
    "nsresult",
    "nsString",
    "nsCString",
    "mozilla::ipc::Shmem",
    "mozilla::ipc::ByteBuf",
    "mozilla::UniquePtr",
    "mozilla::ipc::FileDescriptor",
)


# XXX(Bug 1677487) Can we restrict including ByteBuf.h, FileDescriptor.h,
# MozPromise.h and Shmem.h to those protocols that really use them?
HeaderIncludes = (
    "mozilla/Attributes.h",
    "IPCMessageStart.h",
    "mozilla/RefPtr.h",
    "nsString.h",
    "nsTArray.h",
    "nsTHashtable.h",
    "mozilla/MozPromise.h",
    "mozilla/OperatorNewExtensions.h",
    "mozilla/UniquePtr.h",
    "mozilla/ipc/ByteBuf.h",
    "mozilla/ipc/FileDescriptor.h",
    "mozilla/ipc/IPCForwards.h",
    "mozilla/ipc/Shmem.h",
)

CppIncludes = (
    "ipc/IPCMessageUtils.h",
    "ipc/IPCMessageUtilsSpecializations.h",
    "nsIFile.h",
    "mozilla/ipc/Endpoint.h",
    "mozilla/ipc/ProtocolMessageUtils.h",
    "mozilla/ipc/ProtocolUtils.h",
    "mozilla/ipc/ShmemMessageUtils.h",
    "mozilla/ipc/TaintingIPCUtils.h",
)