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_EXT_IPC_BASIC_TYPES_H_ 18 #define INCLUDE_PERFETTO_EXT_IPC_BASIC_TYPES_H_ 19 20 #include <stddef.h> 21 #include <stdint.h> 22 #include <sys/types.h> 23 24 #include "perfetto/protozero/cpp_message_obj.h" 25 26 namespace perfetto { 27 namespace ipc { 28 29 using ProtoMessage = ::protozero::CppMessageObj; 30 using ServiceID = uint32_t; 31 using MethodID = uint32_t; 32 using ClientID = uint64_t; 33 using RequestID = uint64_t; 34 35 // This determines the maximum size allowed for an IPC message. Trying to send 36 // or receive a larger message will hit DCHECK(s) and auto-disconnect. 37 constexpr size_t kIPCBufferSize = 128 * 1024; 38 39 constexpr uid_t kInvalidUid = static_cast<uid_t>(-1); 40 41 } // namespace ipc 42 } // namespace perfetto 43 44 #endif // INCLUDE_PERFETTO_EXT_IPC_BASIC_TYPES_H_ 45