#include <i_view_module.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <dpl/wrt-dao-ro/widget_dao_types.h>
+#include <dpl/wrt-dao-ro/widget_config.h>
#include <dpl/utils/wrt_global_settings.h>
#include "ewk_context_manager.h"
static const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so");
static const std::string caCertPath("/opt/usr/share/certs/ca-certificate.crt");
-#ifdef __arm__
-const std::string plugins_arch = "plugins/arm";
-#else
-const std::string plugins_arch = "plugins/x86";
-#endif
-
EwkContextManager::EwkContextManager(
const std::string& tizenAppId,
Ewk_Context* ewkContext,
// ewk storage_path set
ewk_context_storage_path_reset(m_ewkContext);
+ std::string pluginsPath =
+ WrtDB::WidgetConfig::GetWidgetNPRuntimePluginsPath(
+ dao.getTizenPkgId());
+
// npruntime plugins path set
- std::ostringstream plugins_path;
- plugins_path << dao.getPath() << plugins_arch;
- LogInfo("ewk_context_additional_plugin_path_set() : " << plugins_path.str());
+ LogInfo("ewk_context_additional_plugin_path_set() : " << pluginsPath);
- ewk_context_additional_plugin_path_set(m_ewkContext, plugins_path.str().c_str());
+ ewk_context_additional_plugin_path_set(m_ewkContext, pluginsPath.c_str());
m_initialized = true;
m_initialized(false),
m_decryptionSupport(new InjectedBundle::DecryptionSupport())
{
- LOG_PROFILE_START("Bundle attachToThread");
- WrtDB::WrtDatabase::attachToThreadRO();
- LOG_PROFILE_STOP("Bundle attachToThread");
+ Try {
+ LOG_PROFILE_START("Bundle attachToThread");
+ WrtDB::WrtDatabase::attachToThreadRO();
+ LOG_PROFILE_STOP("Bundle attachToThread");
+ } Catch (DPL::DB::SqlConnection::Exception::Base) {
+ LogError("## Db attach was failed! Terminate WebProcess by force. ##");
+ exit(-1);
+ }
+
#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
sendWebProcessPid();
#endif
void Bundle::didCreatePage(WKBundlePageRef page)
{
+ if (!m_initialized)
+ {
+ LogError("## Injected-bundle was not initialized! Terminate WebProcess by force. ##");
+ exit(-1);
+ }
+
auto mainFrame = WKBundlePageGetMainFrame(page);
auto context = WKBundleFrameGetJavaScriptContext(mainFrame);
m_pagesList.push_back(page);