1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef REMOTE_OBJECT_INTERNAL_IMPL_H 17 #define REMOTE_OBJECT_INTERNAL_IMPL_H 18 19 #include <thread> 20 21 #include "ipc_object_stub.h" 22 #include "napi_remote_object.h" 23 #include "napi_remote_object_internal.h" 24 25 namespace OHOS { 26 struct CJCallbackParam { 27 int64_t id; 28 uint32_t code; 29 int64_t data; 30 int64_t reply; 31 MessageOption* option; 32 CallingInfo callingInfo; 33 CallingInfo oldCallingInfo; 34 ThreadLockInfo* lockInfo; 35 int result; 36 }; 37 38 class RemoteObjectImpl : public IPCObjectStub { 39 public: 40 RemoteObjectImpl(std::thread::id jsThreadId, const std::u16string& descriptor); 41 42 private: 43 std::thread::id jsThreadId_; 44 }; 45 46 struct CJSendRequestParam { 47 sptr<IRemoteObject> target; 48 uint32_t code; 49 std::shared_ptr<MessageParcel> data; 50 std::shared_ptr<MessageParcel> reply; 51 MessageOption& option; 52 int errCode; 53 int64_t cjDataRef; 54 int64_t cjReplyRef; 55 int64_t callback; 56 std::string traceValue; 57 int32_t traceId; 58 }; 59 } // namespace OHOS 60 #endif // REMOTE_OBJECT_INTERNAL_IMPL_H