namespace ViewModule {
namespace CustomHeaderSupport {
-std::string getValueByField(const std::string field)
+std::string getValueByField(const std::string &field)
{
LogDebug("Field : " << field);
std::string ret;
return ret;
}
} // namespace CustomHeaderSupport
-} // namespace ViewModule
\ No newline at end of file
+} // namespace ViewModule
namespace CustomHeaderSupport {
const std::string ACCEPT_LANGUAGE = "Accept-Language";
-std::string getValueByField(const std::string field);
+std::string getValueByField(const std::string &field);
} // namespace UserAgentSupport
} // namespace CustomHeaderSupport
bool processURI(const DPL::String& inputURI,
bool is_xhr,
const DPL::String& tizenId,
- WKBundleRef bundle)
+ WKBundleRef /*bundle*/)
{
DPL::Optional<DPL::String> uri(inputURI);
if (uri.IsNull()) {
void Bundle::didFinishLoadForResourceCallback(
WKBundlePageRef /*page*/,
- WKBundleFrameRef frame,
+ WKBundleFrameRef /*frame*/,
uint64_t /*resourceIdentifier*/,
- const void* clientInfo)
+ const void* /*clientInfo*/)
{
LogDebug("didFinishLoadForResourceCallback called");
}
DPL::String dplurl = DPL::FromUTF8String(toString(urlStr));
WKRelease(urlStr);
- DPL::Optional<DPL::String> localizedUrl =
+ DPL::Optional<DPL::String> localizedUrl =
BundleURIHandling::localizeURI(dplurl, m_widgetTizenId);
bool ret = BundleURIHandling::processURI(
*localizedUrl,
return request;
} else {
std::string checkUrl = toString(tmpUrl);
- int getFileSize;
if (m_encrypted) {
+ int getFileSize;
if (isEncryptedResource(checkUrl, getFileSize)) {
std::string decryptString = DecryptResource(checkUrl,
getFileSize);
// WARP & ACE Check
DPL::String dplUrl = DPL::FromUTF8String(request_uri);
- DPL::Optional<DPL::String> localizedUrl =
+ DPL::Optional<DPL::String> localizedUrl =
BundleURIHandling::localizeURI(dplUrl, m_widgetTizenId);
bool ret = BundleURIHandling::processURI(
*localizedUrl, true, m_widgetTizenId, m_bundle);
ViewLogic::ViewLogic() :
m_ewkContext(0),
+ m_attachedToCustomHandlerDao(false),
m_currentEwkView(0),
+ m_closedEwkView(NULL),
m_window(NULL),
m_model(0),
m_cbs(new WRT::UserDelegates),
+ m_imeWidth(0),
+ m_imeHeight(0),
m_isBackgroundReload(false),
m_isBackgroundSupport(false),
m_appsSupport(new ViewModule::AppsSupport()),
- m_vibrationSupport(new ViewModule::VibrationSupport()),
- m_attachedToCustomHandlerDao(false)
+ m_vibrationSupport(new ViewModule::VibrationSupport())
{
ApplicationLauncherSingleton::Instance().Touch();
}
m_vibrationSupport->deinitialize();
- while (m_ewkViewList.size()) {
+ while (!m_ewkViewList.empty()) {
LogInfo("pop webview: " << m_ewkViewList.back());
removeEwkView(m_ewkViewList.back());
}
LogInfo("Resetting Widget");
// destory all webview
- while (m_ewkViewList.size()) {
+ while (!m_ewkViewList.empty()) {
LogInfo("pop webview: " << m_ewkViewList.back());
removeEwkView(m_ewkViewList.back());
}
m_isBackgroundReload = true;
PluginModuleSupport::resume(m_ewkContext);
- if (m_ewkViewList.size() != 0) {
- while (m_ewkViewList.size() > 0) {
+ if (!m_ewkViewList.empty()) {
+ while (!m_ewkViewList.empty()) {
if (!m_cbs->bufferUnset.empty()) {
m_cbs->bufferUnset(m_currentEwkView);
}
void windowClose(void);
Ewk_Context* m_ewkContext;
+ bool m_attachedToCustomHandlerDao;
std::list<Evas_Object*> m_ewkViewList;
Evas_Object* m_currentEwkView;
Evas_Object* m_closedEwkView;
std::unique_ptr<ViewModule::AppsSupport> m_appsSupport;
std::unique_ptr<ViewModule::VibrationSupport> m_vibrationSupport;
std::unique_ptr<ViewModule::SecurityOriginSupport> m_securityOriginSupport;
- bool m_attachedToCustomHandlerDao;
static std::map<const std::string, const Evas_Smart_Cb> m_ewkCallbacksMap;
};
bool m_initialized;
int m_sdkLauncherPid;
bool m_debugMode;
- bundle *m_bundle;
unsigned short m_debuggerPort;
ReturnStatus::Type m_returnStatus;
WRT::RunnableWidgetObjectPtr m_widget;
_static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
{
const char *str;
- const char **str_array;
- int len;
- int i;
setenv("PKG_NAME", _get_pkgname(menu_info), 1);
}
if (bundle_get_type(kb, AUL_K_SDK) & BUNDLE_TYPE_ARRAY) {
+ int len;
+ const char **str_array;
str_array = bundle_get_str_array(kb, AUL_K_SDK, &len);
if (str_array != NULL) {
+ int i;
for (i = 0; i < len; i++) {
_D("index : [%d]", i);
__set_sdk_env(menu_info, (char *)str_array[i]);
_D("start real fork and exec\n");
// warning: unused parameter
- argc = argc;
+ (void)argc;
if (execv(argv[0], argv) < 0) { /* Flawfinder: ignore */
if (errno == EACCES) {
app_info_from_db * menu_info, int cmd)
{
// warning: unused parameter
- caller_pid = caller_pid;
+ (void)caller_pid;
bundle_del(kb, AUL_K_PKG_NAME);
bundle_del(kb, AUL_K_EXEC);
}
_D("-- now wait to change cmdline --");
- usleep(50 * 1000); /* 50ms sleep*/
+ struct timespec duration = { 0, 50 * 1000 * 1000 };
+ nanosleep(&duration, NULL); /* 50ms sleep*/
wait_count++;
} while (wait_count <= 20); /* max 50*20ms will be sleep*/
static inline void __socket_garbage_collector()
{
DIR *dp;
- struct dirent *dentry;
+ struct dirent dentry;
+ struct dirent *result;
char tmp[MAX_LOCAL_BUFSZ];
dp = opendir(AUL_SOCK_PREFIX);
return;
}
- while ((dentry = readdir(dp)) != NULL) {
- if (!isdigit(dentry->d_name[0])) {
+ while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
+ if (!isdigit(dentry.d_name[0])) {
continue;
}
- snprintf(tmp, MAX_LOCAL_BUFSZ, "/proc/%s", dentry->d_name);
+ snprintf(tmp, MAX_LOCAL_BUFSZ, "/proc/%s", dentry.d_name);
if (access(tmp, F_OK) < 0) { /* Flawfinder: ignore */
snprintf(tmp, MAX_LOCAL_BUFSZ, "%s/%s", AUL_SOCK_PREFIX,
- dentry->d_name);
+ dentry.d_name);
unlink(tmp);
continue;
}
pid_t child_pgid;
// warning: unused parameter
- signo = signo;
- data = data;
+ (void)signo;
+ (void)data;
child_pgid = getpgid(info->si_pid);
_D("dead_pid = %d pgid = %d", info->si_pid, child_pgid);
#include <sys/smack.h>
#include <errno.h>
#include <fcntl.h>
+#include <time.h>
+
#include "app_sock.h"
#include "simple_util.h"
}
}
- bzero(&saddr, sizeof(saddr));
+ memset(&saddr, 0, sizeof(saddr));
saddr.sun_family = AF_UNIX;
snprintf(saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pid);
unlink(saddr.sun_path);
saddr.sun_family = AF_UNIX;
snprintf(saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pid);
-retry_con:
- ret = __connect_client_sock(fd, (struct sockaddr *)&saddr, sizeof(saddr),
- 100 * 1000);
- if (ret < -1) {
+
+ while ((ret = __connect_client_sock(fd, (struct sockaddr *)&saddr, sizeof(saddr),
+ 100 * 1000)) < -1) {
_E("maybe peer not launched or peer daed\n");
if (retry > 0) {
- usleep(100 * 1000);
+ struct timespec duration = { 0, 100 * 1000 * 1000 };
+ nanosleep(&duration, NULL); /* 100ms sleep*/
retry--;
- goto retry_con;
}
+ else break;
}
+
if (ret < 0) {
close(fd);
return -1;
void *priv)
{
DIR *dp;
- struct dirent *dentry;
+ struct dirent dentry;
+ struct dirent *result;
int pid;
int ret;
char buf[MAX_LOCAL_BUFSZ];
iterfunc = __find_pid_by_cmdline;
}
- while ((dentry = readdir(dp)) != NULL) {
- if (!isdigit(dentry->d_name[0])) {
+ while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
+ if (!isdigit(dentry.d_name[0])) {
continue;
}
- snprintf(buf, sizeof(buf), "/proc/%s/cmdline", dentry->d_name);
+ snprintf(buf, sizeof(buf), "/proc/%s/cmdline", dentry.d_name);
ret = __read_proc(buf, buf, sizeof(buf));
if (ret <= 0) {
continue;
/* support app launched by shell script*/
if (strncmp(buf, BINSH_NAME, BINSH_SIZE) == 0) {
pid =
- iterfunc(dentry->d_name, &buf[BINSH_SIZE + 1],
+ iterfunc(dentry.d_name, &buf[BINSH_SIZE + 1],
priv);
} else {
- pid = iterfunc(dentry->d_name, buf, priv);
+ pid = iterfunc(dentry.d_name, buf, priv);
}
if (pid > 0) {
void *priv)
{
DIR *dp;
- struct dirent *dentry;
+ struct dirent dentry;
+ struct dirent *result;
int _pgid;
int ret = -1;
return -1;
}
- while ((dentry = readdir(dp)) != NULL) {
- if (!isdigit(dentry->d_name[0])) {
+ while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
+ if (!isdigit(dentry.d_name[0])) {
continue;
}
- _pgid = __get_pgid_from_stat(atoi(dentry->d_name));
+ _pgid = __get_pgid_from_stat(atoi(dentry.d_name));
if (pgid == _pgid) {
- ret = iterfunc(atoi(dentry->d_name), priv);
+ ret = iterfunc(atoi(dentry.d_name), priv);
if (ret >= 0) {
break;
}
}
char buffer[1024] = "";
- int ret;
- while ((ret = fread_unlocked(buffer,
- sizeof(char),
- sizeof(buffer)/sizeof(char),
- filehandle)) > 0)
+ while (fread_unlocked(buffer, sizeof(char), sizeof(buffer)/sizeof(char),
+ filehandle) > 0)
{
msg += buffer;
}