1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef INCLUDE_PERFETTO_IPC_BASIC_TYPES_H_ 18 #define INCLUDE_PERFETTO_IPC_BASIC_TYPES_H_ 19 20 #include <stddef.h> 21 #include <stdint.h> 22 #include <sys/types.h> 23 24 namespace google { 25 namespace protobuf { 26 class MessageLite; 27 } // namespace protobuf 28 } // namespace google 29 30 namespace perfetto { 31 namespace ipc { 32 33 using ProtoMessage = ::google::protobuf::MessageLite; 34 using ServiceID = uint32_t; 35 using MethodID = uint32_t; 36 using ClientID = uint64_t; 37 using RequestID = uint64_t; 38 39 // This determines the maximum size allowed for an IPC message. Trying to send 40 // or receive a larger message will hit DCHECK(s) and auto-disconnect. 41 constexpr size_t kIPCBufferSize = 128 * 1024; 42 43 constexpr uid_t kInvalidUid = static_cast<uid_t>(-1); 44 constexpr pid_t kInvalidPid = static_cast<pid_t>(-1); 45 46 } // namespace ipc 47 } // namespace perfetto 48 49 #endif // INCLUDE_PERFETTO_IPC_BASIC_TYPES_H_ 50