#git:framework/web/wrt-plugins-common
Name: wrt-plugins-common
Summary: wrt-plugins common library
-Version: 0.3.102
+Version: 0.3.104
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
# limitations under the License.
#
# Includes CMake configuration file (*.cmake), preserving appropriate paths.
+
+ADD_DEFINITIONS("-DWRT_PLUGINS_COMMON_LOG")
+
macro(include_config_file INCLUDED_CONFIG_FILE_PATH)
get_filename_component(CURRENT_CONFIG_FILE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
include(${CURRENT_CONFIG_FILE_PATH}/${INCLUDED_CONFIG_FILE_PATH}/${CONFIG_FILE_NAME} OPTIONAL)
#include <dpl/event/controller.h>
#include <dpl/type_list.h>
#include <dpl/event/abstract_event_call.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <Commons/ThreadPool.h>
namespace WrtDeviceApis {
{}
virtual void Call()
{
- LogDebug("signaling in SignalEventCall");
+ _D("signaling in SignalEventCall");
m_event->signalSynchronousEventFlag();
}
};
void signalEventByDispatcher(const DPL::SharedPtr<TemplateEvent> &event)
{
- LogDebug("in");
+ _D("called");
Try {
DPL::Event::AbstractEventDispatcher *dispatcher =
ThreadPool::getInstance().getDispatcher(m_threadDispatcher);
Catch(DPL::Thread::Exception::UnmanagedThread) {
// if called on unmanaged thread,
// call signalSynchronousEventFlag() directly
- LogDebug("signalSynchronousEventFlag() is called"
+ _E("signalSynchronousEventFlag() is called"
"by unmanaged thread");
event->signalSynchronousEventFlag();
}
void PostRequest(const DPL::SharedPtr<TemplateEvent> &event,
double delaySeconds = 0.0)
{
- LogDebug(__FUNCTION__);
+ _D("called");
{
DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
assert(TemplateEvent::STATE_INITIAL == event->m_state);
event->m_state = TemplateEvent::STATE_REQUEST_SEND;
}
- LogDebug("state changed to STATE_REQUEST_SEND. Now posting");
if (TemplateEvent::HANDLING_SYNCHRONOUS == event->getHandlingType() &&
!event->m_synchronousEventFlag)
::
PostTimedEvent(event, delaySeconds);
}
- LogDebug("Event posted.");
+
switch (event->getHandlingType()) {
case TemplateEvent::HANDLING_NOT_SET:
assert(0);
break;
case TemplateEvent::HANDLING_SYNCHRONOUS:
- LogDebug("It's synchronous call - waiting for answer...");
event->waitForAnswer();
- LogDebug("...answer received");
break;
}
}
void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
{
- LogDebug(__FUNCTION__);
+ _D("called");
{
DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
if (event->m_cancelled) {
}
event->m_state = TemplateEvent::STATE_REQUEST_RECEIVED;
}
- LogDebug("calling OnRequestReceived");
+
OnRequestReceived(event);
event->signalCancelStatusFlag();
//After Controller ends processing it should call it to signal that work
event->m_state = TemplateEvent::STATE_ANSWER_SEND;
}
}
- LogDebug("choosing the answer method");
+
switch (event->m_handlingType) {
case TemplateEvent::HANDLING_NOT_SET:
assert(0);
// send explicit from the code
case TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER:
case TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER:
- LogDebug("Manual answer is set so do nothing.");
break;
}
}
virtual void ManualAnswer(const DPL::SharedPtr<TemplateEvent> &event)
{
- LogDebug(__FUNCTION__);
+ _D("called");
assert(
event->m_handlingType ==
TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER ||
void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
{
- LogDebug("EventAnswerReceiver: answer received");
+ _D("EventAnswerReceiver: answer received");
//check if it can be processed and set the state
{
- LogDebug("checking the state");
DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
//in case someone changed it to synchronous call, we don't process
event->m_state || TemplateEvent::STATE_ENDED ==
event->m_state)
{
- LogDebug(
- "Handling probably changed to synchronous meanwhile. Will not process it..");
return;
}
//we should get cancelled or answer_send state here
}
event->m_state = TemplateEvent::STATE_ANSWER_RECEIVED;
}
- LogDebug("calling OnAnswerReceived");
+
OnAnswerReceived(event);
- LogDebug("changing the state");
{
DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
assert(TemplateEvent::STATE_ANSWER_RECEIVED == event->m_state);
//if someone is waiting
event->signalFinishedFlag();
}
- LogDebug("leaving");
}
};
}
} \
else \
{ \
- LogInfo("Setting dev cap " << dev_cap_name << " param: " << \
+ LogDebug("Setting dev cap " << dev_cap_name << " param: " << \
param.name << " to value " << param.value); \
devcapit->devCapParams.push_back(param); \
} \
argsVerify(aceFunction, args ...);
if (!(WrtAccessSingleton::Instance().checkAccessControl(aceFunction))) {
- LogDebug("Function is not allowed to run");
- return AceSecurityStatus::AccessDenied;
+ return AceSecurityStatus::AccessDenied;
}
- LogDebug("Function accepted!");
return AceSecurityStatus::AccessGranted;
}
#include <sys/types.h>
#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/scoped_array.h>
#include <dpl/scoped_resource.h>
#include <dpl/assert.h>
void WrtAccess::initialize(int widgetId)
{
- LogDebug("initialize");
+ _D("initialize");
if (widgetId < 0) {
- LogDebug("Invalid widget id");
+ _E("Invalid widget id");
Throw(Exception);
}
if (!m_pluginOwners++) {
+ DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
ace_return_t ret = ace_client_initialize(Wrt::Popup::run_popup);
+ DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
Assert(ACE_OK == ret);
m_widgetId = widgetId;
}
void WrtAccess::deinitialize(int /*widgetId*/)
{
- LogDebug("deinitialize");
+ _D("deinitialize");
if (!--m_pluginOwners) {
+ DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
ace_return_t ret = ace_client_shutdown();
+ DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
Assert(ACE_OK == ret);
}
}
}
}
- LogDebug("constructing ACE request");
+ _D("constructing ACE request");
ace_request_t aceRequest;
aceRequest.session_id =
}
ace_bool_t aceCheckResult = ACE_FALSE;
+ DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
ace_return_t ret = ace_check_access(&aceRequest, &aceCheckResult);
-
+ DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
for (i = 0; i < deviceCount; ++i) {
delete[] aceRequest.dev_cap_list.items[i].param_list.items;
}
delete[] aceRequest.dev_cap_list.items;
if (ACE_OK != ret) {
- LogError("Error in ace check: " << static_cast<int>(ret));
+ _E("Error in ace check: %d", static_cast<int>(ret));
return false;
}
return ACE_TRUE == aceCheckResult;
*/
#include "JSCallbackManager.h"
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
namespace WrtDeviceApis {
namespace CommonsJavaScript {
acceptJSNullAsOnSuccess,
bool acceptJSNullAsOnError)
{
- LogDebug("entered");
JSObjectRef l_onSuccess = NULL;
JSObjectRef l_onError = NULL;
- LogDebug("onSuccessCallback ptr=" << onSuccess);
- LogDebug("onErrorCallback ptr=" << onError);
if (NULL != onSuccess &&
(!acceptJSNullAsOnSuccess || !JSValueIsNull(context, onSuccess)))
{
"success callback is not a function");
}
} else {
- LogWarning("onSuccessCallback is NULL and is not registred");
+ //LogWarning("onSuccessCallback is NULL and is not registred");
}
if (NULL != onError &&
(!acceptJSNullAsOnError || !JSValueIsNull(context, onError)))
"error callback is not a function");
}
} else {
- LogWarning("onErrorCallback is NULL and is not registred");
+ //LogWarning("onErrorCallback is NULL and is not registred");
}
return JSCallbackManagerPtr(new JSCallbackManager(context, l_onSuccess,
l_onError));
m_context(context),
m_object(NULL)
{
- LogDebug("entered");
-
setOnSuccess(onSuccess);
setOnError(onError);
}
JSCallbackManager::~JSCallbackManager()
{
- LogDebug("entered");
-
if (m_onSuccess) {
JSValueUnprotect(m_context, m_onSuccess);
}
void JSCallbackManager::setOnSuccess(JSValueRef onSuccess)
{
- LogDebug("entered");
if (m_onSuccess != NULL) {
JSValueUnprotect(m_context, m_onSuccess);
}
JSValueRef JSCallbackManager::getOnSuccess() const
{
- LogDebug("entered");
return m_onSuccess;
}
void JSCallbackManager::setOnError(JSValueRef onError)
{
- LogDebug("entered");
if (m_onError != NULL) {
JSValueUnprotect(m_context, m_onError);
}
JSValueRef JSCallbackManager::getOnError() const
{
- LogDebug("entered");
return m_onError;
}
void JSCallbackManager::setObject(JSObjectRef object)
{
- LogDebug("entered");
if (m_object != NULL) {
JSValueUnprotect(m_context, m_object);
}
JSObjectRef JSCallbackManager::getObject() const
{
- LogDebug("entered");
return m_object;
}
void JSCallbackManager::setContext(JSContextRef context)
{
- LogDebug("entered");
m_context = context;
}
void JSCallbackManager::callOnSuccess()
{
- LogDebug("entered");
if (m_onSuccess == NULL) {
- LogDebug("Success callback is not set");
+ //LogDebug("Success callback is not set");
return;
}
makeCallback(m_context, NULL, m_onSuccess, NULL, 0);
void JSCallbackManager::callOnSuccess(JSValueRef obj)
{
- LogDebug("entered");
if (m_onSuccess == NULL) {
- LogDebug("Success callback is not set");
+ //LogDebug("Success callback is not set");
return;
}
JSValueRef objParam[1] = { obj };
void JSCallbackManager::callOnSuccess(JSValueRef obj[],
int paramCount)
{
- LogDebug("entered");
if (m_onSuccess == NULL) {
- LogDebug("Success callback is not set");
+ //LogDebug("Success callback is not set");
return;
}
makeCallback(m_context, NULL, m_onSuccess, obj, paramCount);
void JSCallbackManager::callOnError()
{
- LogDebug("entered");
if (m_onError == NULL) {
- LogDebug("Error callback is not set");
+ //LogDebug("Error callback is not set");
return;
}
makeCallback(m_context, NULL, m_onError, NULL, 0);
void JSCallbackManager::callOnError(JSValueRef obj)
{
- LogDebug("entered");
if (m_onError == NULL) {
- LogDebug("Error callback is not set");
+ //LogDebug("Error callback is not set");
return;
}
JSValueRef objParam[1] = { obj };
void JSCallbackManager::callOnError(JSValueRef obj[],
int paramCount)
{
- LogDebug("entered");
if (m_onError == NULL) {
- LogDebug("Error callback is not set");
+ //LogDebug("Error callback is not set");
return;
}
makeCallback(m_context, NULL, m_onError, obj, paramCount);
JSValueRef argv[],
unsigned argc)
{
- LogDebug("entered");
-
if (callback == NULL) {
- LogError("callback is NULL");
+ //LogError("callback is NULL");
return;
}
if (JSObjectIsFunction(context, callback)) {
if (argc == 0) {
- LogDebug("Calling object directly, no arguments");
JSObjectCallAsFunction(context, callback, object, 0, NULL, NULL);
} else {
- LogDebug("Calling object directly, one argument");
JSObjectCallAsFunction(context, callback, object, argc, argv, NULL);
}
return;
#include <js_function_manager.h>
#include <js_overlay_functions.h>
#include <wrt_plugin_export.h>
+#include <dpl/log/secure_log.h>
IMPLEMENT_SAFE_SINGLETON(JsFunctionManager)
bool JsFunctionManager::initialize()
{
- LogInfo("JSObjectDeclaration for js functions are intialized");
+ _D("JSObjectDeclaration for js functions are intialized");
JSObjectDeclarationPtr jsPrintObj(
new JSObjectDeclaration(JavaScriptFunctions::jsPrintPtr));
JsFunctionManager::Functions JsFunctionManager::getFunctions()
{
- LogInfo("get standard js fucntions");
+ _D("get standard js fucntions");
static bool initialized = initialize();
(void) initialized;
return m_functions;
// void* data)
//{
// LogDebug("--| ENTER");
-// LogInfo("Event: " << *event);
+// LogDebug("Event: " << *event);
//}
//
//void Manager::onNetConnectionOpen(const NetErr_t error,
//
//void Manager::onNetStatusChange(NetStatusInfo_t* status, void *userData) {
// LogDebug("--| ENTER");
-// LogInfo("Type: " << status->transportType << ", status: " <<
+// LogDebug("Type: " << status->transportType << ", status: " <<
// status->WiFiStatus);
//}
#include <Commons/Exception.h>
#include <CommonsJavaScript/Converter.h>
#include <dpl/exception.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/foreach.h>
using namespace std;
bool PluginManager::loadChild(const string &name) const
{
- LogInfo("loading " << name);
+ _D("loading %s", name.c_str());
string localUri = m_objectUri;
localUri.append(SEPARATOR).append(name);
WrtDB::DbPluginHandle handle =
WrtDB::PluginDAOReadOnly::getPluginHandleForImplementedObject(localUri);
if (handle == WrtDB::INVALID_PLUGIN_HANDLE) {
- LogError("Plugin not found");
+ _E("Plugin not found");
return false;
}
{
// Error while reading database - widget handle may
// be invalid or some data may be missing in database
- LogError("Cannot get feature list");
+ _E("Cannot get feature list");
return false;
}
{
if (it->pluginId == handle) {
if (it->rejected) {
- LogWarning("Feature rejected by ACE");
+ _E("Feature rejected by ACE");
continue;
}
const_cast<JSGlobalContextRef>(m_context));
}
}
- LogError("Plugin not loaded");
+ _E("Plugin not loaded");
return false;
}
JSValueRef PluginManager::getProperty(const string &name) const
{
- LogDebug("getProperty " << name);
+ _D("getProperty %s", name.c_str());
ObjectList::const_iterator it = m_objectList.find(name);
if (it != m_objectList.end()) {
//return already set value
bool PluginManager::setProperty(const string &name,
JSValueRef value)
{
- LogDebug("setProperty " << name);
+ _D("setProperty %s", name.c_str());
if (m_objectList.count(name) > 0) {
JSValueUnprotect(m_context, m_objectList[name]);
}
bool PluginManager::deleteProperty(const string &name)
{
if (m_objectList.count(name) > 0) {
- LogDebug("deleteProperty " << name);
+ _D("deleteProperty %s", name.c_str());
JSValueUnprotect(m_context, m_objectList[name]);
m_objectList.erase(name);
return true;
}
Catch(WidgetDAOReadOnly::Exception::Base)
{
- LogError("Cannot get feature list");
+ _E("Cannot get feature list");
ReThrow(Commons::PlatformException);
}
if (stat(databaseFile.c_str(), &buffer) != 0) {
//Create fresh database
- LogInfo("Creating database " << databaseFile);
+ LogDebug("Creating database " << databaseFile);
std::fstream file;
file.open(GetWrtWidgetInterfaceDatabaseFilePath(), std::ios_base::in);
#include <algorithm>
#include <dpl/foreach.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include "explorer.h"
#include "plugin_property_support.h"
m_context(context)
{
if (!context) {
- LogError("Context is NULL");
+ _W("Context is NULL");
return;
}
const string& requestedProperty,
JSObjectPtr providedObject)
{
- LogDebug("Requested Property: " << requestedProperty);
+ _D("Requested Property: %s", requestedProperty.c_str());
if (!providedObject) {
- LogError("Provided object is empty");
+ _W("Provided object is empty");
return JSObjectPtr();
}
currentObjectName = currentPropertyRequested.substr(0, pos);
if (currentPropertyRequested.size() <= pos + 1) {
- LogError("Wrong name of requested property");
+ _W("Wrong name of requested property");
return JSObjectPtr();
}
currentPropertyRequested = currentPropertyRequested.substr(pos + 1);
currentObject = getJSObjectProperty(currentObjectName, currentObject);
if (!currentObject) {
- LogError("Failed to get property: " << currentObjectName);
+ _W("Failed to get property: %s", currentObjectName.c_str());
return JSObjectPtr();
}
}
string masterName = declaration->getParentName();
auto pos = masterName.find(".");
if (string::npos != pos) {
- LogError("ParentName not allowed");
+ _W("ParentName not allowed");
return false;
}
auto masterObject = getJSObjectProperty(masterName, m_globalObject);
JSObjectPtr providedObject,
JSGlobalContextRef context)
{
- LogDebug("'" << providedObjectName << "' <- '" << declaration->getName() << "'");
-
+ _D("%s <- %s", providedObjectName.c_str(), declaration->getName().c_str());
std::string fullParentName = declaration->getParentName();
if (fullParentName == providedObjectName) {
+ \r_D("Provided object was matched!!");
return register_(declaration, providedObject, context);
}
- LogDebug("Provided object was not matched!!");
-
//check if object exists in fullParentName
auto pos = fullParentName.find(providedObjectName);
if (pos == string::npos) {
- LogError(
- "Object: " << declaration->getName()
- << " should be child of: " <<
- declaration->getParentName()
- << " but you provided object: " <<
- providedObjectName);
-
+ _W("Object: %s should be child of: %s but you provided object: %s",
+ declaration->getName().c_str(),
+ declaration->getParentName().c_str(),
+ providedObjectName.c_str());
return false;
}
if (fullParentName.size() <= pos + providedObjectName.size() + 1) {
- LogError("Invalid object name");
+ _W("Invalid object name");
return false;
}
currentRequesteProperty, providedObject);
if (!jsObject->getObject()) {
- LogError(
- "Object: '" << declaration->getName()
- << "' should be child of: '" <<
- declaration->getParentName()
- << "'. you provided object: '" <<
- providedObjectName
- << "' but object is null");
-
+ _W("Object: %s should be child of: %s. you provided object: %s but object is null",
+ declaration->getName().c_str(),
+ declaration->getParentName().c_str(),
+ providedObjectName.c_str());
return false;
}
JSObjectPtr parent,
JSGlobalContextRef context)
{
- LogInfo("Registration object: " << declaration->getParentName() <<
- "<-" << declaration->getName());
-
+ _D("Registration object: %s <- %s",
+ declaration->getParentName().c_str(),
+ declaration->getName().c_str());
Assert(parent && "parent object is NULL");
typedef JSObjectDeclaration::Options JO;
JSGlobalContextRef context)
{
if (declaration->getParentName() == GLOBAL_OBJECT_NAME) {
- LogDebug("Connect to Global object of IFRAME");
+ _D("Connect to Global object of IFRAME");
register_(declaration, frameObject, context);
return;
}
//PIM SUPPORT
{
- LogWarning("Connect to NOT global object of IFRAME");
+ _D("Connect to NOT global object of IFRAME");
//it should be master object name
string masterName = declaration->getParentName();
auto pos = masterName.find(".");
if (string::npos != pos) {
- LogError("ParentName not allowed");
+ _W("ParentName not allowed");
return;
}
auto masterObject = getJSObjectProperty(masterName, frameObject);
if (!masterObject->getObject()) {
- LogError("Object not exist in frame");
+ _W("Object not exist in frame");
return;
}
register_(declaration, masterObject, context);
void Explorer::loadFrame(JSGlobalContextRef context)
{
- LogDebug("Frame attached");
-
JSObjectPtr frameObject =
JavaScriptInterfaceSingleton::Instance().getGlobalObject(context);
- LogDebug("Register main frame");
- //register main frame;
-
if (frameObject->getObject() == m_globalObject->getObject()) {
// Main page was already loaded from constructor
- LogDebug("Main page loaded");
+ _W("Main page loaded");
return;
}
FOREACH(object, iframeObjects)
{
- LogDebug("Register object: " << (*object)->getName() );
-
+ _D("Register object: %s", (*object)->getName().c_str());
registerObjectIntoIframe(*object, frameObject, context);
}
}
void Explorer::unloadFrame(JSGlobalContextRef context)
{
- LogDebug("Frame detached");
-
JSObjectPtr frameObject =
JavaScriptInterfaceSingleton::Instance().getGlobalObject(context);
-
m_iframeSupport.unregisterIframe(frameObject);
}
void Explorer::removePluginsFromIframes()
{
- LogDebug("Remove plugins from iframes");
-
if (m_iframeSupport.hasIframes()) {
- LogDebug("Removing iframes");
JavaScriptInterfaceSingleton::Instance().removeIframes(m_context);
}
}
void Explorer::deregisterObject(const JSObjectDeclarationPtr& declaration)
{
- LogDebug("Deregister object " << declaration->getName());
-
if (GLOBAL_OBJECT_NAME != declaration->getParentName()) {
- LogWarning("Ignored remove property " << declaration->getName());
+ _W("Ignored remove property %s", declaration->getName().c_str());
return;
}
void Explorer::cleanIframesData()
{
- LogDebug("Clean iframes data");
m_iframeSupport.clean();
}
args->state,
args->width,
args->height));
- LogInfo("softkeyboard event's state: " << args->state);
+ LogDebug("softkeyboard event's state: " << args->state);
// call js callback function for 'softkeyboardchange' js event on each
// frame
frame, eventType, eventObject);
}
} else {
- LogInfo("Not supported custom event type");
+ LogDebug("Not supported custom event type");
return;
}
#endif
* accessing routines in EFL
*/
#include <javascript_interface.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/scoped_array.h>
#include <vector>
#include <dpl/singleton_impl.h>
#define CHECK_JSVALUE_IS_UNDEFINED_RETURN(context, object, ret) \
if (JSValueIsUndefined(context, object)) { \
- LogError("Object " << #object << " is undefined"); \
+ _E("Object %s is undefined", #object); \
return ret; \
}
#define CHECK_JSOBJECT_IS_NULL_RETURN(object, ret) \
if (!object) { \
- LogError("Object " << #object << " is NULL"); \
+ _E("Object %s is NULL", #object); \
return ret; \
}
DPL::ScopedArray<char> buffer(new char[jsSize]);
size_t written = JSStringGetUTF8CString(arg, buffer.Get(), jsSize);
if (written > jsSize) {
- LogError("Conversion could not be fully performed.");
+ _E("Conversion could not be fully performed.");
return std::string();
}
result = buffer.Get();
const std::string &propertyName,
const JSObjectPtr& propertyObject)
{
- LogInfo("JSObjectSetProperty(" << context << ", \"" << propertyName << "\")");
+ _D("JSObjectSetProperty(%p, \"%s\")", context, propertyName.c_str());
//create name
JSStringRef name = JSStringCreateWithUTF8CString(propertyName.c_str());
//nothing to do -> no context
return;
}
- LogDebug("JSObjectDeleteProperty(" << context << ", \"" << propertyName << "\")");
+ _D("JSObjectDeleteProperty(%p, \"%s\")", context, propertyName.c_str());
JSStringRef name = JSStringCreateWithUTF8CString(propertyName.c_str());
JSObjectDeleteProperty(
static_cast<JSObjectRef>(object->getObject()));
std::size_t count = JSPropertyNameArrayGetCount(properties);
result.reserve(count);
- LogDebug("propesties count " << count);
+ _D("propesties count %d", count);
for (std::size_t i = 0; i < count; ++i) {
JSStringRef property = JSPropertyNameArrayGetNameAtIndex(properties, i);
result.push_back(toString(property));
const std::string &name,
js_function_impl functionImplementation) const
{
- LogDebug("JSObjectMakeFunctionWithCallback(" << context << ", \"" << name << "\")");
+ _D("JSObjectMakeFunctionWithCallback(%p, \"%s\")", context, name.c_str());
JSStringRef jsFunName = JSStringCreateWithUTF8CString(name.c_str());
JSObjectRef object = JSObjectMakeFunctionWithCallback(
JSGlobalContextRef context,
JSObjectDeclaration::ConstClassTemplate classTemplate) const
{
- LogDebug("JSObjectMake(" << context << ")");
+ _D("JSObjectMake(%p)", context);
JSObjectRef object = JSObjectMake(
context,
static_cast<JSClassRef>(
JSGlobalContextRef context,
const std::string &interfaceName) const
{
- LogDebug("makeJSObjectBasedOnInterface(" << context << ", \"" << interfaceName << "\"");
-
+ _D("makeJSObjectBasedOnInterface(%p, \"%s\")", context, interfaceName.c_str());
JSObjectPtr jsInterfaceObj = getJSObjectProperty(context,
getGlobalObject(
context),
JSObjectDeclaration::ConstClassTemplate classTemplate,
JSObjectDeclaration::ConstructorCallback constructorCallback) const
{
- LogDebug("Create JS interface. Context: " << context);
+ _D("makeJSInterface(%p)", context);
JSObjectRef object = JSObjectMakeConstructor(context,
static_cast<JSClassRef>(
const_cast<
declaration->getConstructorCallback());
default:
- LogError("Invalid class type. Making empty JS object.");
+ _E("Invalid class type. Making empty JS object.");
return JSObjectPtr(new JSObject(
JSObjectMake(context, NULL, NULL)));
}
} else {
- LogDebug("No declaration options");
+ _D("No declaration options");
return JSObjectPtr(new JSObject(
JSObjectMake(
context,
const JSObjectPtr& iframe,
const std::string& name)
{
- LogError("Copy object to iframe: " << name);
+ _D("copyObjectToIframe(%s)", name.c_str());
JSGlobalContextRef jsGlobalContext =
static_cast<JSGlobalContextRef>(context);
JavaScriptInterface::getIframesList(JSGlobalContextRef ctx) const
{
JSGlobalContextRef context = static_cast<JSGlobalContextRef>(ctx);
-
- LogDebug("get global object");
JSObjectRef globalObject = JSContextGetGlobalObject(context);
-
ObjectsListPtr retList = getIframesList(context, globalObject);
return retList;
CHECK_JSVALUE_IS_UNDEFINED_RETURN(context, len, ObjectsListPtr());
size_t count = JSValueToNumber(context, len, NULL);
- LogDebug("frames_o.length = " << count);
+ _D("frames_o.length = %%d", count);
ObjectsListPtr retList = ObjectsListPtr(new ObjectsList());
frames_o,
ss.str().c_str());
if (JSValueIsUndefined(context, frame)) {
- LogError("Selected frame is null: frame[" << i << "]");
+ _E("Selected frame is null: frame[%d]", i);
continue;
}
JSObjectRef frame_obj = JSValueToObject(context, frame, NULL);
if (!frame_obj) {
- LogError("frame_obj is NULL.");
+ _E("frame_obj is NULL.");
continue;
}
retList->push_back(JSObjectPtr(new JSObject(frame_obj)));
ObjectsListPtr childList = getIframesList(context, frame_obj);
retList->merge(*childList);
- LogDebug("Frame Value Pointer: " << frame);
- LogDebug("Frame Object Pointer: " << frame_obj);
+ _D("Frame Value Pointer: %p", frame);
+ _D("Frame Object Pointer: %p", frame_obj);
}
return retList;
const std::string& name)
const
{
- LogDebug("getJSObjectProperty(" << ctx << ", \"" << name << "\")");
-
+ _D("makeJSObjectBasedOnInterface(%p, \"%s\")", ctx, name.c_str());
JSObjectRef frame_js = static_cast<JSObjectRef>(frame->getObject());
-
JSValueRef property = getPropertyObj(ctx, frame_js, name.c_str());
-
JSObjectRef objProp = JSValueToObject(ctx, property, NULL);
return JSObjectPtr(new JSObject(objProp));
void JavaScriptInterface::invokeGarbageCollector(JSGlobalContextRef context)
{
- LogDebug("Garbage collection #1");
+ LogDebug("Garbage collection");
JSGarbageCollect(context);
- LogDebug("Garbage collection #2");
JSGarbageCollect(context);
- LogDebug("Garbage collection #3");
JSGarbageCollect(context);
- LogDebug("Garbage collection #4");
JSGarbageCollect(context);
}
#include <dpl/assert.h>
#include <dpl/scoped_array.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/foreach.h>
#include <dpl/singleton_impl.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
m_sessionStarted(false),
m_objectExplorer(NULL)
{
- LogDebug("Initializing Page Session");
+ _D("Initializing Page Session");
m_pluginsSupport = support;
}
stopSession();
}
- LogDebug("Deinitializing plugin Logic...");
+ _D("Deinitializing Page Session");
}
void JSPageSession::Impl::installStandardFunctions()
{
- LogInfo("Installing standard functions...");
+ _D("========== install standard Functions START ==========");
//add standard functions
FOREACH(it, JsFunctionManagerSingleton::Instance().getFunctions()) {
m_objectExplorer->registerObject(*it, NULL);
}
- LogInfo("Installing standard functions...[done]");
+ _D("========== install standard Functions END ==========");
}
void JSPageSession::Impl::installRootPlugins()
{
- LogInfo("Installing requested root plugins...");
+ _D("========== install root Functions START ==========");
PluginContainerSupport::PluginsList rootPlugins =
m_pluginsSupport->getRootPlugins();
installPlugin(*it);
}
- LogInfo("Installing requested root plugins...[done]");
+ _D("========== install root Functions END ==========");
}
bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
PluginPtr library = loadLibrary(plugin);
if (!library) {
- LogError("Loading library failed");
+ _E("Loading library failed");
return false;
}
- LogInfo("Install Plugin : " << library->GetFileName());
+ _D("Install Plugin : %s", library->GetFileName().c_str());
// Register new class
FOREACH(it, *(library->GetClassList()))
{
if (!m_objectExplorer->registerObject(*it, NULL)) {
- LogError("Object Registration failed : " << (*it)->getName());
+ _E("Object Registration failed : %s", (*it)->getName().c_str());
}
}
-
- LogInfo("Install Plugin [done]");
return true;
}
void JSPageSession::Impl::installRequestedFeatures()
{
- LogInfo("Installing requested widget features...");
+ _D("========== install requested Features START ==========");
std::list<std::string> allowedFeatures =
m_pluginsSupport->getAllowedFeatures(m_widgetHandle);
FOREACH(feature, allowedFeatures)
{
- LogDebug("Processing feature: " << *feature);
+ _D("Processing feature: %s", (*feature).c_str());
PluginModelPtr plugin = m_pluginsSupport->getPluginForFeature(*feature);
- if (!plugin)
- {
- LogDebug("It didn't have plugins! : " << *feature);
+ if (!plugin) {
+ _W("It didn't have plugins! : %s", (*feature).c_str());
continue;
}
FOREACH(obj, implObjs)
{
- LogDebug("Processing object: " << *obj);
+ _D("Processing object: %s", (*obj).c_str());
/* This can be optimalized, but would need extra data in database.
* There should be a list of features that are allowed to be
* installed at widget start */
if (obj->find(".") == obj->rfind(".")) {
allowedPlugins.push_back(plugin);
- LogWarning("Plugin will be added: "
- << plugin->LibraryName.Get());
+ _D("Plugin will be added: %s", plugin->LibraryName.Get().c_str());
break;
}
}
FOREACH(plugin, allowedPlugins)
{
- LogDebug("Installation plugin: " << (*plugin)->LibraryName.Get());
+ _D("Installation plugin: %s", (*plugin)->LibraryName.Get().c_str());
installPlugin(*plugin);
}
- LogInfo("requested features installed.");
+ _D("========== install requested Features END ==========");
}
bool JSPageSession::Impl::loadPluginOnDemand(
JavaScriptObject& parentObject,
JSGlobalContextRef context)
{
- LogDebug("load plugin with feature");
-
Assert(parentObject.instance &&
!parentObject.name.empty()
&& "Wrong arguments");
if (!m_sessionStarted) {
- LogError("Session not started");
+ _W("Session not started");
return false;
}
// //TODO here may be a bug. if plugin contains feature rejected and
// accepted
- // LogInfo("Installing feature : " << widgetFeature.name);
+ // LogDebug("Installing feature : " << widgetFeature.name);
// if (widgetFeature.rejected) {
// LogWarning("This api-feature was rejected");
// return;
PluginPtr library = loadLibrary(plugin);
if (!library) {
- LogError("Loading library failed");
+ _E("Loading library failed");
return false;
}
- LogInfo("Install Plugin '" << library->GetFileName());
+ _D("Install Plugin %s", library->GetFileName().c_str());
if (!(parentObject.instance)) {
- LogError("NULL pointer value");
+ _E("NULL pointer value");
return false;
}
JSObjectPtr parent(new JSObject(parentObject.instance));
if (!parent->getObject()) {
- LogError("NULL pointer value");
+ _E("NULL pointer value");
assert(false);
return false;
}
context);
if (!installationStatus) {
- LogError(
- "Object Registration failed : " << (*it)->getName()
- <<
- "; Parent object name: " << parentObject.name);
+ _E("Object Registration failed : %s; Parent object name: %s",
+ (*it)->getName().c_str(),
+ parentObject.name.c_str());
return false;
}
}
- LogDebug("Plugin on demand registration completed");
+ _D("Plugin on demand registration completed");
return true;
}
const char* encodedBundle,
const char* theme)
{
- LogInfo(
- "set properties of window object " << scaleFactor << ", "
- << encodedBundle << ", " <<
- theme);
-
m_objectExplorer->getWindowPropertySupport()
->setScaleToNavigatorProperty(scaleFactor);
m_objectExplorer->getWindowPropertySupport()
{
// Check if session is already started
if (!m_sessionStarted) {
- LogWarning("Session not started!");
+ _W("Session not started!");
return;
}
-
- LogInfo("Request dispatching javascript event");
m_objectExplorer->callEventListeners(eventType, data);
}
const char* encodedBundle,
const char* theme)
{
- LogInfo("Starting widget session...");
// Check if corresponding session if not already created
if (m_sessionStarted) {
- LogWarning("Session already started!");
+ _W("Session already started!");
return;
}
// set scale, bundle as window's property
setCustomProperties(scaleFactor, encodedBundle, theme);
-
- LogInfo("Starting widget session...[done]");
}
void JSPageSession::Impl::stopSession()
{
- LogInfo("Stopping widget session...");
-
if (!m_sessionStarted) {
- LogWarning("Session not started!");
+ _W("Session not started!");
return;
}
unloadPluginsFromSession();
m_sessionStarted = false;
-
- LogInfo("Widget session stopped.");
}
void JSPageSession::Impl::unloadPluginsFromSession()
{
- LogDebug("Unload plugins from session");
-
m_objectExplorer->removePluginsFromIframes();
m_objectExplorer->cleanIframesData();
// delete js object for plugins
FOREACH(pluginIt, m_loadedPlugins)
{
- LogDebug("Unregistering plugin " << (*pluginIt)->GetFileName());
-
+ _D("Unregistering plugin %s", (*pluginIt)->GetFileName().c_str());
(*pluginIt)->OnWidgetStop(m_widgetHandle);
- LogDebug("Emitted WidgetStop for plugin: " <<
- (*pluginIt)->GetFileName());
- FOREACH(it, *((*pluginIt)->GetClassList()))
- {
+ FOREACH(it, *((*pluginIt)->GetClassList())) {
m_objectExplorer->deregisterObject(*it);
}
}
(*pluginIt)->LibraryInstance.Set(PluginPtr());
}
- LogInfo("unloaded " << unloadedLibraries << " unreferenced libraries!");
+ LogDebug("unloaded " << unloadedLibraries << " unreferenced libraries!");
#endif
}
pluginLib = Plugin::LoadFromFile(path);
if (!pluginLib) {
- LogError("Loading library failed");
+ _E("Loading library failed");
} else {
pluginModel->LibraryInstance.Set(pluginLib);
- LogDebug("On widget start");
+ _D("On widget start");
// This is first time for this plugin, start widget Session
pluginLib->OnWidgetStart(
m_widgetHandle);
}
}
} else {
- LogDebug("Get from LibraryInstance");
- LogDebug("On widget start");
+ _D("Get from LibraryInstance");
+ _D("On widget start");
// This is first time for this plugin, start widget Session
pluginLib->OnWidgetStart(
m_widgetHandle);
void JSPageSession::Impl::loadFrame(JSGlobalContextRef context)
{
- LogDebug("Load a frame");
-
if (!m_sessionStarted) {
- LogWarning("Session NOT started!");
+ _W("Session NOT started!");
return;
}
FOREACH(pluginIt, m_loadedPlugins)
{
- LogDebug("Try to call 'OnFrameLoad' callback : " << (*pluginIt)->GetFileName());
-
+ _D("Try to call 'OnFrameLoad' callback : %s",
+ (*pluginIt)->GetFileName().c_str());
(*pluginIt)->OnFrameLoad(context);
}
void JSPageSession::Impl::unloadFrame(JSGlobalContextRef context)
{
- LogDebug("Unload a frame");
-
if (!m_sessionStarted) {
- LogWarning("Session NOT started!");
+ _W("Session NOT started!");
return;
}
FOREACH(pluginIt, m_loadedPlugins)
{
- LogDebug("Try to call 'OnFrameUnload' callback : " << (*pluginIt)->GetFileName());
-
+ _D("Try to call 'OnFrameUnload' callback : %s",
+ (*pluginIt)->GetFileName().c_str());
(*pluginIt)->OnFrameUnload(context);
}
* @brief This file is the implementation file of plugin
*/
#include "plugin.h"
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/assert.h>
#include <dlfcn.h>
Plugin::~Plugin()
{
- LogInfo("Unloading plugin library: " << m_fileName << "...");
+ _D("Unloading plugin library: %s", m_fileName.c_str());
// Unload library
if (dlclose(m_libHandle) != 0) {
- LogError("Cannot close plugin handle");
+ _E("Cannot close plugin handle");
} else {
- LogDebug("Library is unloaded");
+ _D("Library is unloaded");
}
}
{
static bool logEnable = (getenv("WRT_LOAD_PLUGINS_LOG_ENABLE") != NULL);
- LogDebug("LoadFromFile" << fileName);
+ _D("LoadFromFile %s", fileName.c_str());
void *dllHandle;
dllHandle = dlopen(fileName.c_str(), RTLD_LAZY);
- LogDebug("dlopen() done!");
+ _D("dlopen() done!");
if (dllHandle == NULL) {
const char* error = (const char*)dlerror();
- LogError(
- "Failed to load plugin: " << fileName <<
- ". Reason: " << (error != NULL ? error : "unknown"));
+ _E("Failed to load plugin: %s. Reason: %s",
+ fileName.c_str(),
+ (error != NULL ? error : "unknown"));
PluginPtr empty;
return empty;
}
if (getWidgetEntityMapProcPtr) {
rawClassList = (*getWidgetEntityMapProcPtr)();
- if (logEnable)
- {
- LogDebug(
- "rawClassList : " << rawClassList <<
- "by getWidgetClassMapProcPtr()");
+ if (logEnable) {
+ _D("rawClassList : %p by getWidgetClassMapProcPtr()",
+ rawClassList);
}
} else {
rawClassList =
static_cast<const js_entity_definition_t *>(dlsym(dllHandle,
PLUGIN_CLASS_MAP_NAME));
- if (logEnable) { LogDebug("rawClassList : " << rawClassList); }
+ if (logEnable) { _D("rawClassList : %p", rawClassList); }
}
if (NULL == onWidgetStartProcPtr || NULL == onWidgetStopProcPtr ||
/*NULL == onWidgetInitProcPtr ||*/ NULL == rawClassList)
{
- if (logEnable)
- {
- LogWarning("#####");
- LogWarning(
- "##### Warning: The following plugin does not support new plugin API.");
- LogWarning(
- "##### Old plugin API is deprecated. Please update it to new API");
- LogWarning("#####");
- LogWarning(
- "##### Plugin: " << fileName <<
- " has got deprecated or invalid API");
- LogWarning("#####");
+ if (logEnable) {
+ _W("#####");
+ _W("##### Warning: The following plugin does not support new plugin API.");
+ _W("##### Old plugin API is deprecated. Please update it to new API");
+ _W("#####");
+ _W("##### Plugin: %s has got deprecated or invalid API", fileName.c_str());
+ _W("#####");
}
// Will not load plugin
return empty;
}
- if (logEnable)
- {
- LogInfo("#####");
- LogInfo("##### Plugin: " << fileName << " supports new plugin API");
- LogInfo("#####");
- LogInfo("##### $onWidgetStartProc: " << onWidgetStartProcPtr);
- LogInfo("##### $onWidgetInitProc: " << onWidgetInitProcPtr);
- LogInfo("##### $onWidgetStopProc " << onWidgetStopProcPtr);
- LogInfo("##### $onFrameLoadProc " << onFrameLoadProcPtr);
- LogInfo("##### $onFrameUnloadProc " << onFrameUnloadProcPtr);
- LogInfo("##### $classMap: " << reinterpret_cast<const void *>(rawClassList));
- LogInfo("##### ");
- LogInfo("##### Class map:");
+ if (logEnable) {
+ _D("#####");
+ _D("##### Plugin: %s supports new plugin API", fileName.c_str());
+ _D("#####");
+ _D("##### $onWidgetStartProc: %p", onWidgetStartProcPtr);
+ _D("##### $onWidgetInitProc: %p", onWidgetInitProcPtr);
+ _D("##### $onWidgetStopProc %p", onWidgetStopProcPtr);
+ _D("##### $onFrameLoadProc %p", onFrameLoadProcPtr);
+ _D("##### $onFrameUnloadProc %p", onFrameUnloadProcPtr);
+ _D("##### $classMap: %p", reinterpret_cast<const void *>(rawClassList));
+ _D("##### ");
+ _D("##### Class map:");
}
const js_entity_definition_t *rawEntityListIterator = rawClassList;
if (logEnable)
{
// Logging
- LogInfo("#####");
- LogInfo("##### [" << rawEntityListIterator->object_name << "]: ");
- LogInfo("##### Interface: " <<
- rawEntityListIterator->interface_name);
- LogInfo("##### Parent: " << rawEntityListIterator->parent_name);
+ _D("#####");
+ _D("##### [%s]", rawEntityListIterator->object_name);
+ _D("##### Interface: %s", rawEntityListIterator->interface_name);
+ _D("##### Parent: %s", rawEntityListIterator->parent_name);
}
// Register class
}
// Load export table
- LogDebug("Plugin successfuly loaded");
+ _D("Plugin successfuly loaded");
// Insert to loaded modules list
{
if (NULL != m_apiOnWidgetStart) {
(*m_apiOnWidgetStart)(widgetId);
- LogInfo("Called!");
+ _D("Called!");
}
}
Assert(NULL != mapping && "NULL mapping interface provided");
if (NULL != m_apiOnWidgetInit) {
(*m_apiOnWidgetInit)(mapping);
- LogInfo("Called!");
+ _D("Called!");
}
}
{
if (NULL != m_apiOnWidgetStop) {
(*m_apiOnWidgetStop)(widgetId);
- LogInfo("Called!");
+ _D("Called!");
}
}
{
if (NULL != m_apiOnFrameLoad) {
(*m_apiOnFrameLoad)(context);
- LogInfo("Called!");
+ _D("Called!");
}
}
{
if (NULL != m_apiOnFrameUnload) {
(*m_apiOnFrameUnload)(context);
- LogInfo("Called!");
+ _D("Called!");
}
}
#include <fstream>
+#include <dpl/log/secure_log.h>
#include <dpl/foreach.h>
#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
#include <dpl/wrt-dao-ro/global_config.h>
std::list<std::string> allowedFeatures;
FOREACH(it, features) {
- LogInfo("Loading api-feature: " << it->name);
+ _D("Loading api-feature: %s", DPL::ToUTF8String(it->name).c_str());
if (it->rejected) {
- LogWarning("Api-feature was rejected by ace. (Api-feature name: "
- << it->name << ")");
+ _W("Api-feature was rejected by ace. (Api-feature name: %s)",
+ it->name.c_str());
continue;
}
if (appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
FOREACH(it_rootPluginHandle, m_rootPluginsList)
{
- LogDebug("*it_rootPluginHandle: " << *it_rootPluginHandle);
+ _D("*it_rootPluginHandle: %d", *it_rootPluginHandle);
registerPluginModel(*it_rootPluginHandle);
}
} else {
- LogDebug("Not defined app type");
+ _D("Not defined app type");
}
m_initialized = true;
}
DeviceCapList
deviceCapabilities)
{
- LogDebug("Analyzing feature: " << handle);
FeatureModelPtr model = getFeatureModel(handle);
if (model) {
- LogDebug("Model for feature:" << handle << " already created");
+ _D("Model for feature: %d already created", handle);
return;
}
- LogDebug("Creating Model for feature:" << handle);
+ _D("Creating Model for feature: %d", handle);
model.reset(new FeatureModel(handle));
PluginModelPtr model = getPluginModelById(handle);
if (model) {
- LogDebug("Model for plugin:" << handle << " already registered");
+ _D("Model for plugin: %d already registered", handle);
return;
}
- LogDebug("Creating Model for plugin: " << handle);
-
if (PluginDAOReadOnly::INSTALLATION_COMPLETED !=
PluginDAOReadOnly::getInstallationStateForHandle(handle))
{
- LogWarning("Failed To CreateModel for handle " << handle);
+ _W("Failed To CreateModel for handle %d", handle);
return;
}
model.Reset(new PluginModel(handle));
- LogInfo("Model Created. Handle: " <<
- handle << ", name: " << model->LibraryName.Get());
+ \r_D("Model Created. Handle: %d, name: %s",
+ handle,
+ model->LibraryName.Get().c_str());
m_pluginModels.insert(model);
}
void PluginContainerSupport::readRootPluginsList()
{
- LogDebug("Reading root plugins list from so files...");
-
+ _D("Reading root plugins list from so files...");
m_rootPluginsList = PluginDAOReadOnly::getRootPluginHandleList();
}
PluginModelPtr
PluginContainerSupport::getPluginModel(const FeatureModelPtr &feature) const
{
- if (!feature)
- {
- LogDebug("Null Ptr for feature model");
+ if (!feature) {
+ _D("Null Ptr for feature model");
return PluginModelPtr();
- }
- else
- {
- LogDebug("Feature located in plugin: " << feature->PHandle.Get());
+ } else {
+ _D("Feature located in plugin: %d", feature->PHandle.Get());
return getPluginModelById(feature->PHandle.Get());
}
}
{
PluginsList plugins;
- FOREACH(it, m_rootPluginsList)
- {
+ FOREACH(it, m_rootPluginsList) {
PluginModelPtr plugin = getPluginModelById(*it);
if (!plugin) {
- LogError("PluginModel not found");
+ _W("PluginModel not found");
continue;
}
PluginContainerSupport::PluginsList
PluginContainerSupport::getPluginsList() const
{
- LogDebug("");
-
PluginsList plugins;
- FOREACH(it, m_pluginModels)
- {
+ FOREACH(it, m_pluginModels) {
plugins.push_back(*it);
}
#include <algorithm>
#include <dpl/foreach.h>
+#include <dpl/log/secure_log.h>
void IframesSupport::registerDeclaration(
const JSObjectDeclarationPtr& declaration)
{
- LogDebug("Registration iframes-supported plugins " <<
- declaration->getName());
+ _D("Registration iframes-supported plugins %s", declaration->getName().c_str());
if (declaration->getParentName().find('.') != std::string::npos) {
- LogWarning("The object will not be loaded to iframes");
+ _E("The object will not be loaded to iframes");
return;
}
m_iframesObjects.push_back(declaration);
void IframesSupport::registerIframe(const JSObjectPtr& iframe)
{
- LogDebug("LoadedIframes size: " << m_loadedIframes.size() );
+ _D("LoadedIframes size: %d", m_loadedIframes.size() );
m_loadedIframes.insert(iframe);
}
void IframesSupport::unregisterIframe(const JSObjectPtr& iframe)
{
- LogDebug("LoadedIframes size: " << m_loadedIframes.size() );
+ _D("LoadedIframes size: %d", m_loadedIframes.size() );
auto it_loaded = std::find_if(m_loadedIframes.begin(),
m_loadedIframes.end(),
std::bind2nd(EqualToJSObjectPtr(), iframe));
//object not found, so thats the new iframe
if (it_loaded == m_loadedIframes.end()) {
- LogDebug("Nothing to unregister");
+ _D("Nothing to unregister");
return;
}
#include <dpl/assert.h>
#include <dpl/scoped_array.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/foreach.h>
#include <dpl/singleton_impl.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#define PLUGIN_LOGIC_SANITY_CHECK \
if (!s_sanityCheck) \
{ \
- LogError("Object is not available. Wrong flow occured"); \
+ _E("Object is not available. Wrong flow occured"); \
return; \
}
s_sanityCheck = true;
DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
- LogDebug("Initializing Plugin Logic...");
+ _D("Initializing Plugin Logic...");
m_pluginsSupport = PluginContainerSupportPtr(new PluginContainerSupport());
// explicit call to keep singleton's lifetime until calling destructor.
PluginLogic::Impl::~Impl()
{
- LogDebug("");
+ _D("called");
s_sanityCheck = false;
FOREACH(it, m_sessions)
{
- LogError("Must stop widget session before exit!");
+ _W("Must stop widget session before exit!");
it->second->stopSession();
}
-
- LogDebug("Deinitializing plugin Logic...");
}
void PluginLogic::initSession(int widgetHandle)
void PluginLogic::performLibrariesUnload()
{
- LogError("Libraries unload TURNED OFF");
+ _W("This function is DEPRECATED");
// m_impl->performLibrariesUnload();
}
void PluginLogic::loadPluginsIntoIframes(JSGlobalContextRef /*context*/)
{
- LogError("This function is Deprecated");
+ _W("This function is DEPRECATED");
}
void PluginLogic::setCustomProperties(double /*scaleFactor*/,
const char* /*encodedBundle*/,
const char* /*theme*/)
{
- LogError("This function is DEPRECATED");
+ _W("This function is DEPRECATED");
}
void PluginLogic::setCustomProperties(JSGlobalContextRef context,
void PluginLogic::dispatchJavaScriptEvent(CustomEventType /*eventType*/)
{
- LogError("This function is DEPRECATED");
+ _W("This function is DEPRECATED");
}
void PluginLogic::dispatchJavaScriptEvent(JSGlobalContextRef context,
void PluginLogic::Impl::initSession(int widgetHandle)
{
- LogInfo("init pluginLogic...");
+ _D(">---------------------[init session START]---------------------<");
m_pluginsSupport->Initialize(widgetHandle);
-
- //add standard objects
- LogDebug("Preload plugins so file");
-
PluginContainerSupport::PluginsList rootPluginList =
m_pluginsSupport->getRootPlugins();
pluginLib = Plugin::LoadFromFile(path);
if (!pluginLib) {
- LogError("Loading library failed");
+ _W("Loading library failed");
} else {
pluginModel->LibraryInstance.Set(pluginLib);
-
- LogDebug(
- "pluginModel->LibraryInstance.Set() : " <<
- pluginLib->GetFileName());
+ _D("pluginModel->LibraryInstance.Set() : %s",
+ pluginLib->GetFileName().c_str());
}
} else {
- LogDebug("Already loaded");
+ _D("Already loaded");
}
}
-
- LogDebug("Preload plugins so file_done");
+ _D("========== init session END ==========");
}
void PluginLogic::Impl::startSession(int widgetHandle,
const char* encodedBundle,
const char* theme)
{
- LogInfo("Starting widget session...");
+ _D("========== start session START ==========");
if (!m_pluginsSupport->isInitialized()) {
m_pluginsSupport->Initialize(widgetHandle);
// Check if corresponding session if not already created
if (sessionIt != m_sessions.end()) {
- LogWarning("Session already started!");
- return;
+ _W("Session already started!");
+ } else {
+ auto newSession = JSPageSessionPtr(new JSPageSession(m_pluginsSupport));
+ newSession->startSession(widgetHandle,
+ context,
+ scaleFactor,
+ encodedBundle,
+ theme);
+
+ m_sessions[context] = newSession;
}
-
- auto newSession = JSPageSessionPtr(new JSPageSession(m_pluginsSupport));
- newSession->startSession(widgetHandle,
- context,
- scaleFactor,
- encodedBundle,
- theme);
-
- m_sessions[context] = newSession;
+ _D("========== start session END ==========");
}
void PluginLogic::Impl::stopSession(JSGlobalContextRef context)
{
- LogInfo("Stopping widget session...");
+ _D("========== stop session START ==========");
auto sessionIt = m_sessions.find(context);
if (sessionIt == m_sessions.end()) {
- LogError("Session not exist!");
- return;
+ _W("Session not exist!");
+ } else {
+ sessionIt->second->stopSession();
+ m_sessions.erase(sessionIt);
}
-
- sessionIt->second->stopSession();
- m_sessions.erase(sessionIt);
-
- LogInfo("Widget session stopped.");
+ _D("========== stop session END ==========");
}
bool PluginLogic::Impl::loadPluginOnDemand(
JSGlobalContextRef context
)
{
- LogInfo("Load plugin on demand");
+ _D("========== load ondemand plugin ==========");
auto sessionIt = m_sessions.find(context);
if (sessionIt == m_sessions.end()) {
- LogWarning("Session not exist!");
+ _W("Session not exist!");
return false;
}
void PluginLogic::Impl::loadFrame(JSGlobalContextRef context)
{
- LogDebug("Load a frame");
-
+ _D("========== load frame START ==========");
PLUGIN_LOGIC_SANITY_CHECK
auto sessionIt = m_sessions.find(context);
if (sessionIt == m_sessions.end()) {
- LogWarning("Session not exist!");
- return;
+ _W("Session not exist!");
+ } else {
+ sessionIt->second->loadFrame(context);
}
-
- sessionIt->second->loadFrame(context);
+ _D("========== load frame END ==========");
}
void PluginLogic::Impl::unloadFrame(JSGlobalContextRef context)
{
- LogDebug("Unload a frame");
-
+ _D("========== unload frame START ==========");
PLUGIN_LOGIC_SANITY_CHECK
auto sessionIt = m_sessions.find(context);
if (sessionIt == m_sessions.end()) {
LogWarning("Session not exist!");
- return;
- }
-
- sessionIt->second->unloadFrame(context);
+ } else {
+ sessionIt->second->unloadFrame(context);
- // I don't know why this session should be removed here.
- // session list is removed also from stopSession().
- //m_sessions.erase(sessionIt);
+ // I don't know why this session should be removed here.
+ // session list is removed also from stopSession().
+ //m_sessions.erase(sessionIt);
+ }
+ _D("========== unload frame END ==========");
}
void PluginLogic::Impl::setCustomProperties(JSGlobalContextRef context,
const char* encodedBundle,
const char* theme)
{
- LogInfo(
- "set properties of window object " << scaleFactor << ", "
- << encodedBundle << ", " <<
- theme);
-
PLUGIN_LOGIC_SANITY_CHECK
auto sessionIt = m_sessions.find(context);
if (sessionIt == m_sessions.end()) {
- LogWarning("Session not exist!");
+ _W("Session not exist!");
return;
}
CustomEventType eventType,
void* data)
{
- LogDebug("Dispatch event");
-
PLUGIN_LOGIC_SANITY_CHECK
auto sessionIt = m_sessions.find(context);
if (sessionIt == m_sessions.end()) {
- LogWarning("Session not exist!");
+ _W("Session not exist!");
return;
}
unsigned int PluginLogic::Impl::windowHandle() const
{
- if (!s_sanityCheck)
- {
+ if (!s_sanityCheck) {
LogError("Object is not available. Wrong flow occured");
}
return m_windowHandle;
void PluginLogic::Impl::setWindowHandle(unsigned int handle)
{
PLUGIN_LOGIC_SANITY_CHECK
- LogDebug("XWindow handle " << handle);
m_windowHandle = handle;
}
*/
#include "plugin_property_support.h"
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
using namespace PluginModule;
void WindowPropertySupport::setScaleToNavigatorProperty(const double scale)
{
- LogInfo("set window.navigator.scale: " << scale);
-
+ _D("set window.navigator.scale: %ld", scale);
m_scale = scale;
-
setPropertyToNavigator(SCALE_PROPERTY_NAME,
JSValueMakeNumber(m_context, scale));
}
void WindowPropertySupport::setBundleToWindowProperty(const char* bundle)
{
- LogInfo("set window.__bundle: " << bundle);
-
+ _D("set window.__bundle: %s", bundle);
if (bundle) {
m_bundle = bundle;
-
JSStringRef bundleString = JSStringCreateWithUTF8CString(bundle);
-
setPropertyToWindow(BUNDLE_PROPERTY_NAME,
JSValueMakeString(m_context, bundleString));
-
JSStringRelease(bundleString);
}
}
void WindowPropertySupport::setThemeToNavigatorProperty(const char* theme)
{
- LogInfo("set window.navigator.__theme: " << theme);
-
+ _D("set window.navigator.__theme: %s", theme);
if (theme) {
m_theme = theme;
-
JSStringRef themeString = JSStringCreateWithUTF8CString(theme);
-
setPropertyToNavigator(THEME_PROPERTY_NAME,
JSValueMakeString(m_context, themeString));
-
JSStringRelease(themeString);
}
}
void WindowPropertySupport::setPropertyToWindow(const char* propertyName,
JSValueRef jsValue)
{
+ _D("et property to window : %s", propertyName);
if (propertyName) {
JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
-
JSStringRef propertyNameString =
JSStringCreateWithUTF8CString(propertyName);
JSObjectSetProperty(m_context,
jsValue,
kJSPropertyAttributeReadOnly,
NULL);
-
JSStringRelease(propertyNameString);
}
}
void WindowPropertySupport::setPropertyToNavigator(const char* propertyName,
JSValueRef jsValue)
{
+ _D("set property to navigator : %s", propertyName);
if (propertyName) {
JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
PluginsInstaller::PluginsInstaller() :
m_initialized(false)
{
- LogInfo("PluginsInstaller created.");
+ LogDebug("PluginsInstaller created.");
}
PluginsInstaller::~PluginsInstaller()
{
- LogInfo("PluginsInstaller destroyed.");
+ LogDebug("PluginsInstaller destroyed.");
}
void PluginsInstaller::checkDatabaseTablesExistance()
LogError("Plugins installer not initialized.");
return ReturnStatus::NotInitialized;
}
- LogInfo("Plugin installation started. Checking path: " << libPath);
+ LogDebug("Plugin installation started. Checking path: " << libPath);
if (!PluginUtils::checkPath(libPath)) {
return ReturnStatus::WrongPluginPath;
}
- LogInfo("Plugin path ok. Searching for config file...");
+ LogDebug("Plugin path ok. Searching for config file...");
std::string metaFileName = libPath + DIRECTORY_SEPARATOR +
std::string(WrtDB::GlobalConfig::GetPluginMetafileName());
PluginMetafileData pluginInfo;
pluginInfo.m_libraryName = getLibraryName(libPath);
- LogInfo(
+ LogDebug(
"Config file done. Lib name: " << pluginInfo.m_libraryName
<<
". Searching for installed plugin...");
if (WrtDB::PluginDAO::isPluginInstalled(pluginInfo.m_libraryName)) {
- LogInfo("Plugin already installed.");
+ LogDebug("Plugin already installed.");
return ReturnStatus::AlreadyInstalled;
}
- LogInfo("Plugin not installed. Loading library file...");
+ LogDebug("Plugin not installed. Loading library file...");
PluginObjectsPtr libraryObjects;
PluginHandle pluginHandle;
}
libraryObjects = PluginObjectsPtr(new PluginObjects());
- LogInfo("#####");
- LogInfo("##### Plugin: " << filename << " supports new plugin API");
- LogInfo("#####");
+ LogDebug("#####");
+ LogDebug("##### Plugin: " << filename << " supports new plugin API");
+ LogDebug("#####");
FOREACH(o, *plugin->GetObjects()) {
libraryObjects->addObjects(CAST(*o)->GetParentName(),
return ReturnStatus::LoadingLibraryError;
}
- LogInfo("Library loaded. Registering plugin...");
+ LogDebug("Library loaded. Registering plugin...");
Try
{
pluginHandle =
PluginDAO::registerPlugin(pluginInfo, libPath);
- LogInfo("Plugin registered. Registering features...");
+ LogDebug("Plugin registered. Registering features...");
FOREACH(it, pluginInfo.m_featureContainer)
{
FeatureDAO::RegisterFeature(*it, pluginHandle);
}
- LogInfo("Features registered. Registering objects...");
+ LogDebug("Features registered. Registering objects...");
registerPluginObjects(pluginHandle, libraryObjects);
- LogInfo("Registration done. Resolving dependencies...");
+ LogDebug("Registration done. Resolving dependencies...");
//TODO: can it be replaced with resolvePluginDependencies(handle)
if (!registerAndUpdateInstallation(pluginHandle, libraryObjects)) {
return ReturnStatus::DatabaseError;
}
- LogInfo("Plugin installed successfully.");
+ LogDebug("Plugin installed successfully.");
return ReturnStatus::Success;
}
PluginObjectsPtr PluginsInstaller::loadLibraryFromMetafile(
const std::string& libName) const
{
- LogInfo("Loading library: " << libName);
+ LogDebug("Loading library: " << libName);
void *dlHandle = dlopen(libName.c_str(), RTLD_NOW);
if (dlHandle == NULL) {
PluginObjectsPtr libraryObjects = PluginObjectsPtr(new PluginObjects());
const js_entity_definition_t *rawEntityListIterator = rawEntityList;
- LogInfo("#####");
- LogInfo("##### Plugin: " << libName << " is using deprecated API");
- LogInfo("#####");
+ LogDebug("#####");
+ LogDebug("##### Plugin: " << libName << " is using deprecated API");
+ LogDebug("#####");
while (rawEntityListIterator->parent_name != NULL &&
rawEntityListIterator->object_name != NULL)
{
- LogInfo("##### [" << rawEntityListIterator->object_name << "]: ");
- LogInfo("##### Parent: " << rawEntityListIterator->parent_name);
- LogInfo("#####");
+ LogDebug("##### [" << rawEntityListIterator->object_name << "]: ");
+ LogDebug("##### Parent: " << rawEntityListIterator->parent_name);
+ LogDebug("#####");
libraryObjects->addObjects(rawEntityListIterator->parent_name,
rawEntityListIterator->object_name);
}
if (WrtDB::PluginDAO::isPluginInstalled(pluginData->m_libraryName)) {
- LogInfo("Plugin already installed.");
+ LogDebug("Plugin already installed.");
return ReturnStatus::AlreadyInstalled;
}
Try {
PluginHandle pluginHandle =
PluginDAO::registerPlugin(*pluginData, path);
- LogInfo("Plugin registered. Registering features...");
+ LogDebug("Plugin registered. Registering features...");
FOREACH(it, pluginData->m_featureContainer)
{
FeatureDAO::RegisterFeature(*it, pluginHandle);
}
- LogInfo("Features registered. Registering objects...");
+ LogDebug("Features registered. Registering objects...");
registerPluginObjects(pluginHandle, objects);
- LogInfo("Objects registered. Finishing...");
+ LogDebug("Objects registered. Finishing...");
if (!registerAndUpdateInstallation(pluginHandle, objects)) {
return ReturnStatus::InstallationWaiting;
return ReturnStatus::DatabaseError;
}
- LogInfo("Plugin installed successfully.");
+ LogDebug("Plugin installed successfully.");
return ReturnStatus::Success;
}
return INSTALLATION_ERROR;
}
- LogInfo("Plugin DIRECTORY IS" << PLUGIN_PATH);
+ LogDebug("Plugin DIRECTORY IS" << PLUGIN_PATH);
int return_code;
struct dirent libdir;
struct dirent* result;
int installedPluginsCount = 0;
ReturnStatus ret = ReturnStatus::Unknown;
FOREACH(it, pluginsPaths) {
- LogInfo("Preparing to plugin installation: " << *it);
+ LogDebug("Preparing to plugin installation: " << *it);
ret = installPlugin(*it);
if (ReturnStatus::Success == ret) {
++installedPluginsCount;
- LogInfo("Plugin " << *it << " installed.");
+ LogDebug("Plugin " << *it << " installed.");
} else if (ReturnStatus::InstallationWaiting == ret) {
LogWarning("Plugin not installed. Waiting for dependency");
} else {
printf("\n");
installedPluginsCount += installWaitingPlugins();
m_registry.UnloadAll();
- LogInfo("Installed " << installedPluginsCount
+ LogDebug("Installed " << installedPluginsCount
<< " plugins of total: " << pluginsPaths.size());
return installedPluginsCount;
}
PluginsInstaller::OptionalPluginMetafileData PluginsInstaller::parseMetafile(
const std::string& path) const
{
- LogInfo("Plugin Config file::" << path);
+ LogDebug("Plugin Config file::" << path);
Try
{
PluginMetafileData pluginInfo;
int main(int /*argc*/, char */*argv*/[])
{
DPL::Log::LogSystemSingleton::Instance().SetTag("PLUGINS_INSTALLER");
- LogInfo("Plugins installation started.");
+ LogDebug("Plugins installation started.");
printf("Installing plugins...\n");
PluginsInstallerSingleton::Instance().initialize();
PluginsInstallerSingleton::Instance().deinitialize();
printf("Completed: %d plugins installed.\n", installed);
- LogInfo("All plugins installed successfuly");
+ LogDebug("All plugins installed successfuly");
return 0;
}
#include <WKBundle.h>
#include <WKString.h>
#include <WKType.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/assert.h>
static WKBundleRef s_injectedBundleRef = NULL;
void IPCMessageSupport::setWKBundleRef(WKBundleRef bundleRef)
{
- LogDebug("setWKBundleRef called");
+ _D("called");
s_injectedBundleRef = bundleRef;
}
void IPCMessageSupport::setXwindowHandle(unsigned int handle)
{
- LogDebug("setXwindowHandle called");
+ _D("called");
s_xWindowHandle = handle;
}
const char* name,
const char* body)
{
- LogDebug("sendMessageToUiProcess called");
+ _D("called");
if (s_injectedBundleRef == NULL) {
- LogError("UI Process information isn't set");
+ _E("UI Process information isn't set");
return NULL;
}
- LogDebug("name = [" << name << "]");
+ _D("name = [%s]", name);
if (body) {
- LogDebug("body = [" << body << "]");
+ _D("body = [%s]", body);
}
if (!name) {
int IPCMessageSupport::sendAsyncMessageToUiProcess(const char* name, const char* body, AsyncReplyCallback replyCallback, void* data)
{
- LogDebug("sendAsyncMessageToUiProcess called");
+ _D("called");
if (s_injectedBundleRef == NULL)
{
- LogError("UI Process information isn't set");
+ _E("UI Process information isn't set");
return -1;
}
if (name == NULL)
{
- LogError("msg name is null!");
+ _E("msg name is null!");
return -1;
}
body = "";
}
- LogDebug("name = [" << name << "]");
- LogDebug("body = [" << body << "]");
+ _D("name = [%s]", name);
+ if (!body) {
+ _D("body = [%s]", body);
+ }
return sendAsyncMessage(name, body, replyCallback, data);
}
void* IPCMessageSupport::ignoreAsyncMessageReply(int handle)
{
- LogDebug("ignoreAsyncMessageReply called");
+ _D("called");
AsyncConnectionPtr connection = AsyncConnectionManager::instance().getConnection(handle);
void IPCMessageSupport::replyAsyncMessageToWebProcess(Ewk_Context* ewkContext, int handle, const char* body)
{
- LogDebug("replyAsyncMessageToWebProcess called");
+ _D("called");
if (ewkContext == NULL)
{
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+ADD_DEFINITIONS("-DWRT_PLUGINS_WIDGET_LOG")
+
set(TARGET_NAME "wrt-plugins-w3c-widget-interface")
pkg_search_module(webkit2 REQUIRED ewebkit2)
#include <string>
#include <dpl/assert.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/optional.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#define CATCH_EXCEPTION_NO_MODIFABLE \
Catch(Commons::LocalStorageValueNoModifableException) { \
- LogError("The item is read only"); \
+ _E("The item is read only"); \
return JSDOMExceptionFactory:: \
NoModificationAllowedException.make(context, exception); \
}
#define CATCH_EXCEPTION_CONVERSION \
Catch(Commons::ConversionException) { \
- LogError("Error on conversion"); \
+ _E("Error on conversion"); \
return JSDOMExceptionFactory:: \
UnknownException.make(context, exception); \
}
#define CATCH_EXCEPTION_NULL_PTR \
Catch(Commons::NullPointerException) { \
- LogError("Error on pointer, null value"); \
+ _E("Error on pointer, null value"); \
return JSDOMExceptionFactory:: \
UnknownException.make(context, exception); \
}
#define CATCH_EXCEPTION_PLATFORM_ERROR \
Catch(Commons::PlatformException){ \
- LogError("PlatformException occured"); \
+ _E("PlatformException occured"); \
return JSDOMExceptionFactory:: \
UnknownException.make(context, exception); \
}
#define CATCH_EXCEPTION_SECURITY \
Catch(Commons::SecurityException){ \
- LogError("Security exception occured"); \
+ _E("Security exception occured"); \
return JSDOMExceptionFactory:: \
SecurityException.make(context, exception); \
}
#define CATCH_EXCEPTION_OUT_OF_RANGE \
Catch(Commons::OutOfRangeException) { \
- LogError("OutOfRangeException"); \
+ _E("OutOfRangeException"); \
return JSDOMExceptionFactory:: \
QuotaExceededException.make(context, exception); \
}
#define CATCH_EXCEPTION_INVALID_ARG \
Catch(Commons::InvalidArgumentException) { \
- LogError("Pair for given key doesnt exist"); \
+ _E("Pair for given key doesnt exist"); \
return JSValueMakeNull(context); \
}
namespace W3C {
ILocalStoragePtr getIStorage(JSObjectRef arg)
{
- LogWarning("get localstorage object");
-
+ _D("get localstorage object");
LocalStoragePrivateData* priv =
static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(arg));
if (!priv) {
- LogError("Private object not initialized");
+ _E("Private object not initialized");
ThrowMsg(Commons::NullPointerException,
"Private object not initialized");
}
JSObjectRef getWidgetObject(JSObjectRef arg)
{
- LogWarning("get widget object");
-
+ _D("get widget object");
LocalStoragePrivateData* priv =
static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(arg));
if (!priv) {
- LogError("Private object not initialized");
+ _E("Private object not initialized");
ThrowMsg(Commons::NullPointerException,
"Private object not initialized");
}
void JSPreferences::initialize(JSContextRef context,
JSObjectRef object)
{
- LogDebug("entered. Context: " << context);
+ _D("entered. Context: %p", context);
LocalStoragePrivateData* priv =
static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
void JSPreferences::finalize(JSObjectRef object)
{
- LogDebug("entered");
+ _D("entered");
LocalStoragePrivateData* priv =
static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
delete priv;
- LogDebug("private object is realised");
}
JSValueRef JSPreferences::removeItem(JSContextRef context,
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ _D("entered");
Try {
Converter converter(context);
DispatchEventSupport::dispatchStorageEvent(g_context, key, oldValue, newValue, "");
- LogDebug("end");
return JSValueMakeNull(context);
}
CATCH_EXCEPTION_NO_MODIFABLE
}
JSValueRef JSPreferences::setItem(JSContextRef context,
- JSObjectRef object,
+ JSObjectRef /*object*/,
JSObjectRef thisObject,
size_t /*argumentCount*/,
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
- LogDebug("This: " << thisObject);
- LogDebug("Object: " << object);
+ _D("entered");
Try {
Converter converter(context);
DispatchEventSupport::dispatchStorageEvent(g_context, key, oldValue, newValue, "");
- LogDebug("end");
-
return JSValueMakeUndefined(context);
}
CATCH_EXCEPTION_NO_MODIFABLE
const JSValueRef /*arguments*/[],
JSValueRef* exception)
{
- LogDebug("entered");
+ _D("entered");
Try {
getIStorage(thisObject)->clear(false);
DispatchEventSupport::dispatchStorageEvent(g_context, null, null, null, "");
- LogDebug("end");
-
return JSValueMakeNull(context);
}
CATCH_EXCEPTION_NULL_PTR
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ _D("entered");
Try {
Converter converter(context);
std::string key = converter.tryString(arguments[0]);
- LogDebug("Getting item for key " << key);
+ _D("Getting item for key %s", key.c_str());
DPL::Optional<std::string> value =
getIStorage(thisObject)->getValue(key);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ _D("entered");
Try {
if (argumentCount < 1) {
- LogError("No argument found");
+ _E("No argument found");
Throw(Commons::InvalidArgumentException);
}
std::string value = getIStorage(thisObject)->getKeyByIndex(n);
- LogDebug("end");
-
return converter.toJSValueRef(value);
}
CATCH_EXCEPTION_CONVERSION
JSStringRef /*propertyName*/,
JSValueRef* exception)
{
- LogDebug("enter");
+ _D("enter");
Try
{
JSObjectRef object,
JSStringRef propertyName)
{
- LogDebug("enter");
+ _D("enter");
Try {
Converter converter(context);
}
Catch(Commons::InvalidArgumentException) {
- LogDebug("Pair for given key doesnt exist");
+ _E("Pair for given key doesnt exist");
}
Catch(Commons::ConversionException) {
- LogError("Error on conversion");
+ _E("Error on conversion");
}
Catch(Commons::NullPointerException) {
- LogError("Error on pointer, null value");
+ _E("Error on pointer, null value");
}
Catch(Commons::PlatformException){
- LogError("PlatformException occured");
+ _E("PlatformException occured");
}
return false;
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ _D("enter");
Try {
Converter converter(context);
DPL::Optional<std::string> value =
getIStorage(object)->getValue(key);
- LogDebug("end");
-
if (!value) {
return JSValueMakeNull(context);
} else {
JSValueRef jvalue,
JSValueRef* exception)
{
- LogDebug("enter");
+ _D("enter");
Try {
Converter converter(context);
DispatchEventSupport::dispatchStorageEvent(g_context, key, oldValueStr, newValueStr, "");
- LogDebug("end");
-
return true;
}
CATCH_EXCEPTION_NO_MODIFABLE
* @brief
*/
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
void on_widget_init_callback(feature_mapping_interface_t *mapping)
{
- LogDebug("[W3C\\widget] on_widget_init_callback");
+ _D("[W3C\\widget] on_widget_init_callback");
WrtPlugins::W3C::WidgetDeclarations::getMappingInterface(mapping);
}
void on_widget_start_callback(int widgetId)
{
- LogDebug("[W3C\\widget] on_widget_start_callback (" << widgetId << ")");
+ _D("[W3C\\widget] on_widget_start_callback (%d)", widgetId);
Try
{
}
Catch(Commons::Exception)
{
- LogError("Wrt wrapper registration failed");
+ _E("Wrt wrapper registration failed");
return;
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[W3C\\widget] on_widget_stop_callback (" << widgetId << ")");
+ _D("[W3C\\widget] on_widget_stop_callback (%d)", widgetId);
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("Wrt wrapper registration failed");
+ _E("Wrt wrapper registration failed");
return;
}
}
void* /*event_info*/,
void* data)
{
- LogInfo("ButtonCallback");
+ LogDebug("ButtonCallback");
Assert(m_initialized);
AnswerCallbackData answerData;
EvasObject getBaseObject()
{
if (getExternalCanvas() == NULL) {
- LogInfo("Create old style popup");
+ LogDebug("Create old style popup");
EvasObject win(elm_win_add(NULL, "Popup", ELM_WIN_DIALOG_BASIC));
elm_win_borderless_set(win, EINA_TRUE);
elm_win_alpha_set(win, EINA_TRUE);
evas_object_show(win);
return win;
} else {
- LogInfo("Create new style popup");
+ LogDebug("Create new style popup");
EvasObject win(getExternalCanvas());
evas_object_show(win);
return win;
// show buution
switch (buttonObjectList.size()) {
case 0:
- LogInfo("no button");
+ LogDebug("no button");
break;
case 1:
DoRender(buttonObjectList.at(0),
void WrtPopup::OnStop()
{
- LogInfo("On Stop");
+ LogDebug("On Stop");
}
void WrtPopup::OnCreate()
if (!openPipes()) {
PostEvent(QuitEvent());
}
- LogInfo("On Create");
+ LogDebug("On Create");
}
void WrtPopup::OnResume()
return -1;
}
- LogInfo("Starting tests");
+ LogDebug("Starting tests");
WrtDB::WrtDatabase::attachToThreadRW();