mirror of
https://gitee.com/openharmony/communication_ipc
synced 2024-11-26 17:41:17 +00:00
!1496 增加 CanPromote函数判断wptr是否可以提升为sptr
Merge pull request !1496 from dengliang/master
This commit is contained in:
commit
dc8fe18aaf
@ -18,6 +18,9 @@ SUBSYSTEM_DIR = "//foundation/communication/ipc"
|
||||
|
||||
config("ipc_all_deps_config") {
|
||||
include_dirs = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include" ]
|
||||
if (is_emulator) {
|
||||
defines = [ "EMULATOR_PLATFORM" ]
|
||||
}
|
||||
}
|
||||
|
||||
ohos_prebuilt_shared_library("ipc_core") {
|
||||
|
@ -242,6 +242,10 @@ public:
|
||||
|
||||
void SetObjectDied(bool isDied);
|
||||
|
||||
#ifndef EMULATOR_PLATFORM
|
||||
bool CanPromote() override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
int SendLocalRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &optionoption);
|
||||
int SendRequestInner(bool isLocal, uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option);
|
||||
|
@ -70,6 +70,7 @@
|
||||
"OHOS::IPCObjectProxy::IsObjectDead()";
|
||||
"OHOS::IPCObjectStub::IsObjectDead()";
|
||||
"virtual thunk to OHOS::IRemoteObject::GetInterfaceDescriptor()";
|
||||
"virtual thunk to OHOS::IPCObjectProxy::CanPromote()";
|
||||
"OHOS::IRemoteObject::GetInterfaceDescriptor()";
|
||||
"OHOS::IPCObjectProxy::GetInterfaceDescriptor()";
|
||||
"OHOS::IPCObjectStub::GetInterfaceDescriptor()";
|
||||
|
@ -23,6 +23,9 @@ config("libipc_single_private_config") {
|
||||
|
||||
config("ipc_all_deps_config") {
|
||||
include_dirs = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include" ]
|
||||
if (is_emulator) {
|
||||
defines = [ "EMULATOR_PLATFORM" ]
|
||||
}
|
||||
}
|
||||
|
||||
ohos_shared_library("ipc_single") {
|
||||
|
@ -70,6 +70,7 @@
|
||||
"OHOS::IPCObjectProxy::IsObjectDead()";
|
||||
"OHOS::IPCObjectStub::IsObjectDead()";
|
||||
"virtual thunk to OHOS::IRemoteObject::GetInterfaceDescriptor()";
|
||||
"virtual thunk to OHOS::IPCObjectProxy::CanPromote()";
|
||||
"OHOS::IRemoteObject::GetInterfaceDescriptor()";
|
||||
"OHOS::IPCObjectProxy::GetInterfaceDescriptor()";
|
||||
"OHOS::IPCObjectStub::GetInterfaceDescriptor()";
|
||||
|
@ -616,6 +616,13 @@ uint32_t IPCObjectProxy::GetStrongRefCountForStub()
|
||||
return invoker->GetStrongRefCountForStub(handle_);
|
||||
}
|
||||
|
||||
#ifndef EMULATOR_PLATFORM
|
||||
bool IPCObjectProxy::CanPromote()
|
||||
{
|
||||
return (GetSptrRefCount() > 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_IPC_SINGLE
|
||||
int IPCObjectProxy::UpdateProto()
|
||||
{
|
||||
|
@ -38,6 +38,9 @@ public:
|
||||
MockIPCObjectProxy() : IPCObjectProxy(1, u"mockProxyService") {};
|
||||
~MockIPCObjectProxy() {};
|
||||
|
||||
#ifndef EMULATOR_PLATFORM
|
||||
MOCK_METHOD0(CanPromote, bool());
|
||||
#endif
|
||||
MOCK_METHOD0(GetObjectRefCount, int32_t());
|
||||
MOCK_METHOD0(GetSessionName, std::string());
|
||||
MOCK_METHOD0(GetInterfaceDescriptor, std::u16string());
|
||||
|
Loading…
Reference in New Issue
Block a user