#include <dpl/wrt-dao-ro/WrtDatabase.h>
#include <dpl/localization/localization_utils.h>
#include <dpl/string.h>
+#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <dpl/utils/mime_type_utils.h>
#include <dpl/localization/LanguageTagsProvider.h>
#include <js_overlay_types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <privilege-control.h>
+
// URI localization on WebProcess side
#include "bundle_uri_handling.h"
extern "C" {
const char * const VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
const char * const VIEWMODE_TYPE_MAXIMIZED = "maximized";
const std::size_t FILE_BUF_MAX_SIZE = 1024; // bytes
+const std::size_t PLAIN_CHUNK_SIZE = 1008; // bytes
+const unsigned int UID_ROOT = 0;
+const unsigned int DEFAULT_PRIORITY = 0;
+const char * const PRIVILEGE_APP_TYPE = "wgt";
+
static bool m_initWebApp = false;
Tizen::Base::ByteBuffer *DecryptChunkByTrustZone(
m_widgetTizenId = DPL::FromASCIIString(msgString);
WrtDB::WidgetDAOReadOnly dao(m_widgetTizenId);
+
+ // process pool - set app_privilige
+ if (UID_ROOT == getuid())
+ {
+ using namespace WrtDB::GlobalConfig;
+
+ std::string appPath;
+ std::string tzAppId = DPL::ToUTF8String(dao.getTzAppId());
+ std::string tzPkgId = DPL::ToUTF8String(dao.getTizenPkgId());
+
+ appPath = appPath + GetUserInstalledWidgetPath() + "/" +
+ tzPkgId + GetUserWidgetExecPath() + "/" + tzAppId;
+
+ LogDebug("set_app_privilege(" << appPath << ")");
+ set_app_privilege(tzPkgId.c_str(), PRIVILEGE_APP_TYPE, appPath.c_str());
+ }
+
/* This type of message is received when widget is restarting
* (proably in other situation too). Widget restart can be
* called after system language change so language tags have to
WKRelease(urlStr);
WKRelease(retVal);
WKRelease(blockMessage);
+ return WKBundlePagePolicyActionPassThrough;
}
// get scheme string
&Bundle::didReceiveMessageCallback
};
WKBundleSetClient(bundle, &client);
+
+ // process pool - restore process priority
+ if (UID_ROOT == getuid())
+ {
+ setpriority(PRIO_PROCESS, 0, DEFAULT_PRIORITY);
+ }
}
}