const char* const INJECTED_BUNDLE_LIBRARY = "/usr/lib/libwrt-injected-bundle.so";
const char* const START_SESSION_FUNCTION = "DynamicPluginStartSession";
const char* const URL_PARSING_FUNCTION = "DynamicUrlParsing";
+const char* const SET_WIDGET_INFO_FUNCTION = "DynamicSetWidgetInfo";
const char* const DATABASE_ATTACH_FUNCTION = "DynamicDatabaseAttach";
}
: m_handle(0),
m_startSession(0),
m_parseURL(0),
+ m_setWidgetInfo(0),
m_databaseAttach(0) {
m_handle = dlopen(INJECTED_BUNDLE_LIBRARY, RTLD_LAZY);
if (!m_handle) {
if (!m_parseURL) {
LOG(ERROR) << "No " << URL_PARSING_FUNCTION << " symbol found!\n";
}
+ *reinterpret_cast<void **>(&m_setWidgetInfo) = dlsym(m_handle, SET_WIDGET_INFO_FUNCTION);
+ if (!m_setWidgetInfo) {
+ LOG(ERROR) << "No " << SET_WIDGET_INFO_FUNCTION << " symbol found!";
+ }
*reinterpret_cast<void **>(&m_databaseAttach) = dlsym(m_handle, DATABASE_ATTACH_FUNCTION);
if (!m_databaseAttach) {
LOG(ERROR) << "No " << DATABASE_ATTACH_FUNCTION << " symbol found!\n";
m_parseURL(old_url, new_url, widget_id);
}
+void DynamicPlugin::setWidgetInfo(int widgetHandle) {
+ if (!m_setWidgetInfo)
+ return;
+ m_setWidgetInfo(widgetHandle);
+}
+
DynamicPlugin::~DynamicPlugin() {
if (m_databaseAttach)
m_databaseAttach(0);
typedef void (*onIPCMessageFun)(const tizen_webview::WrtIpcMessageData&);
typedef void (*parseUrlFun)(std::string*, std::string*, int);
+typedef void (*setWidgetInfoFun)(int);
typedef void (*databaseAttachFun)(int);
class DynamicPlugin {
const char* theme);
void parseURL(std::string* old_url, std::string* new_url, int widget_id);
-
+ void setWidgetInfo(int widgetHandle);
void messageReceived(const tizen_webview::WrtIpcMessageData& data);
~DynamicPlugin();
void* m_handle;
startSessionFun m_startSession;
parseUrlFun m_parseURL;
+ setWidgetInfoFun m_setWidgetInfo;
databaseAttachFun m_databaseAttach;
onIPCMessageFun m_onIPCMessage;
};
scale_ = scaleFactor;
theme_ = theme;
encodedBundle_ = encodedBundle;
+ DynamicPlugin::instance().setWidgetInfo(widgetHandle_);
}
void WrtWidget::ParseUrl(const GURL& url, GURL& new_url) {