From: Piotr Kosko
Date: Fri, 3 Jul 2015 07:58:56 +0000 (+0200)
Subject: [Common] replaced call GetCurrentExtension()->GetRuntimeVariable()
X-Git-Tag: submit/tizen/20150702.103311^2~1^2~21^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a520670612570e6e29fcb68a847e54d2ffe9f600;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Common] replaced call GetCurrentExtension()->GetRuntimeVariable()
[Feature] replaced for performance purposes.
[Verification] code compiles without errors.
Change-Id: I7dfaca5d11276d1afededbb6ceb6536222a3b117
Signed-off-by: Piotr Kosko
---
diff --git a/src/common/tools.cc b/src/common/tools.cc
index 679f2c0a..cc06772b 100644
--- a/src/common/tools.cc
+++ b/src/common/tools.cc
@@ -18,6 +18,7 @@
#ifdef PRIVILEGE_USE_DB
#include
+#include "common/current_application.h"
#elif PRIVILEGE_USE_ACE
#include
#elif PRIVILEGE_USE_CYNARA
@@ -83,7 +84,7 @@ class AccessControlImpl {
const char* kQuery = "select name from WidgetFeature where app_id = "
"(select app_id from WidgetInfo where tizen_appid = ?)"
" and rejected = 0";
- const std::string app_id = common::GetCurrentExtension()->GetRuntimeVariable("app_id", 64);
+ const std::string app_id = common::CurrentApplication::GetInstance().GetApplicationId();
sqlite3_stmt* stmt = nullptr;
ret = sqlite3_prepare_v2(db, kQuery, -1, &stmt, nullptr);
diff --git a/src/common/virtual_fs.cc b/src/common/virtual_fs.cc
index a2dc177a..78d5f9d3 100755
--- a/src/common/virtual_fs.cc
+++ b/src/common/virtual_fs.cc
@@ -14,6 +14,7 @@
#include "common/logger.h"
#include "common/optional.h"
#include "common/scope_exit.h"
+#include "common/current_application.h"
namespace {
@@ -88,7 +89,7 @@ bool OnStorageDeviceSupported(int storage_id, storage_type_e type,
common::optional GetRootDir() {
LoggerD("Enter");
- std::string app_id = common::GetCurrentExtension()->GetRuntimeVariable("app_id", 64);
+ std::string app_id = common::CurrentApplication::GetInstance().GetApplicationId();
app_info_h app_info;
int err = app_info_create(app_id.c_str(), &app_info);