Use modified tizen_base::Parcel 86/281986/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 26 Sep 2022 02:35:54 +0000 (02:35 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 26 Sep 2022 02:35:54 +0000 (02:35 +0000)
To improve the performance of the parcel creation, the implementation of
the Parcel is changed. It uses malloc() instead of std::vector.

Requires:
 - https://review.tizen.org/gerrit/#/c/platform/core/base/bundle/+/281779/

Change-Id: Iba427db6a0e5624fdb6cc5a0b0290cc4960d3fa0
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/esd_cion/cion_ondemand_server.cc

index 2493ac3..13f9923 100644 (file)
@@ -171,7 +171,7 @@ void CionOndemandServer::OnOndemandListRequested(
   std::string list_service_name = ondemand_parcel.ReadString();
   _D("Ondemand Service_name : %s", list_service_name.c_str());
   if (list_header == std::string("OndemandList")) {
-    raw = GetOndemandList(list_service_name).GetRaw();
+    raw = GetOndemandList(list_service_name).ToRaw();
     if (raw.size() == 0)
       return;
   }
@@ -278,7 +278,7 @@ void CionOndemandServer::LoadOndemandServiceList() {
 
       std::shared_ptr<CionPeerInfo> pi =
           std::make_shared<CionPeerInfo>(std::string(service_name),
-          parcel.GetRaw().data(), parcel.GetRaw().size());
+          parcel.GetData(), parcel.GetDataSize());
       ondemand_peer_list_.emplace_back(pi);
 
       free(uuid);
@@ -319,8 +319,8 @@ void CionOndemandServer::AddOndemandServiceList(std::string service_name,
   parcel.WriteString(display_name);
 
   std::shared_ptr<CionPeerInfo> pi =
-      std::make_shared<CionPeerInfo>(service_name, parcel.GetRaw().data(),
-      parcel.GetRaw().size());
+      std::make_shared<CionPeerInfo>(service_name, parcel.GetData(),
+          parcel.GetDataSize());
   ondemand_peer_list_.emplace_back(pi);
   free(uuid);
 
@@ -365,4 +365,4 @@ tizen_base::Parcel CionOndemandServer::GetOndemandList(
   parcel.WriteBool(false);
 
   return parcel;
-}
\ No newline at end of file
+}