已开启
refactor: remove renderSession from SessionInfo #805
ohci1创建于 6月18日
refactor: remove renderSession from SessionInfo #805
已开启
ohci1创建于 6月18日
2 个文件变更+17-0
@@ -49,6 +49,7 @@ public:
49 static SessionInfo* Unmarshalling(Parcel& parcel);49 static SessionInfo* Unmarshalling(Parcel& parcel);
50 50 
51 sptr<IRemoteObject> sessionToken = nullptr;51 sptr<IRemoteObject> sessionToken = nullptr;
52+ sptr<IRemoteObject> renderSession = nullptr;
52 sptr<IRemoteObject> callerSession = nullptr;53 sptr<IRemoteObject> callerSession = nullptr;
53 sptr<IRemoteObject> callerToken = nullptr;54 sptr<IRemoteObject> callerToken = nullptr;
54 sptr<IRemoteObject> parentToken = nullptr;55 sptr<IRemoteObject> parentToken = nullptr;
@@ -68,6 +68,18 @@ bool SessionInfo::DoMarshallingOne(Parcel& parcel) const
68 }68 }
69 }69 }
70 70 
71+ if (renderSession) {
72+ if (!parcel.WriteBool(true) ||
73+ !(static_cast<MessageParcel*>(&parcel))->WriteRemoteObject(renderSession)) {
74+ ABILITYBASE_LOGE("Write renderSession failed");
75+ return false;
76+ }
77+ } else {
78+ if (!parcel.WriteBool(false)) {
79+ return false;
80+ }
81+ }
82+ 
71 if (callerSession) {83 if (callerSession) {
72 if (!parcel.WriteBool(true) ||84 if (!parcel.WriteBool(true) ||
73 !(static_cast<MessageParcel*>(&parcel))->WriteRemoteObject(callerSession)) {85 !(static_cast<MessageParcel*>(&parcel))->WriteRemoteObject(callerSession)) {
@@ -404,6 +416,10 @@ SessionInfo* SessionInfo::Unmarshalling(Parcel& parcel)
404 info->sessionToken = (static_cast<MessageParcel*>(&parcel))->ReadRemoteObject();416 info->sessionToken = (static_cast<MessageParcel*>(&parcel))->ReadRemoteObject();
405 }417 }
406 418 
419+ if (parcel.ReadBool()) {
420+ info->renderSession = (static_cast<MessageParcel*>(&parcel))->ReadRemoteObject();
421+ }
422+ 
407 if (parcel.ReadBool()) {423 if (parcel.ReadBool()) {
408 info->callerSession = (static_cast<MessageParcel*>(&parcel))->ReadRemoteObject();424 info->callerSession = (static_cast<MessageParcel*>(&parcel))->ReadRemoteObject();
409 }425 }