From 5fa34187d958dc291cf278f3b550753e81f964ab Mon Sep 17 00:00:00 2001 From: "sung-su.kim" Date: Fri, 26 Jul 2013 08:29:18 +0900 Subject: [PATCH] [Release] wrt-commons_0.2.139 Change-Id: I07fcc079e1f2b235ac25b93afda43ec757557656 --- CMakeLists.txt | 1 + build/CMakeLists.txt | 1 + build/i18n/CMakeLists.txt | 20 ++++ build/i18n/wrt-commons-i18n-dao-ro.pc.in | 12 ++ etc/wrt_commons_create_clean_db.sh | 2 +- examples/dbus/server-example/server-example.cpp | 4 +- examples/fake_rpc/fake_rpc.cpp | 56 +++++----- examples/metronome/metronome_client.cpp | 10 +- examples/metronome/metronome_server.cpp | 8 +- examples/rpc/rpc.cpp | 72 ++++++------ examples/simple/simple.cpp | 2 +- examples/socket/socket.cpp | 18 +-- examples/tcpsock/tcpsock.cpp | 12 +- examples/timed_event/timed_event.cpp | 4 +- modules/CMakeLists.txt | 1 + modules/certificate_dao/dao/certificate_dao.cpp | 2 +- modules/core/config.cmake | 1 + modules/core/include/dpl/preprocessor.h | 6 + modules/core/include/dpl/scope_guard.h | 109 ++++++++++++++++++ .../db/include/dpl/db/thread_database_support.h | 6 +- .../include/dpl/dbus/dbus_interface_dispatcher.h | 4 +- modules/dbus/src/server.cpp | 4 +- modules/i18n/CMakeLists.txt | 1 + modules/i18n/dao/CMakeLists.txt | 59 ++++++++++ .../wrt-commons/i18n-dao-ro/i18n_dao_read_only.h | 39 +++++++ .../wrt-commons/i18n-dao-ro/i18n_database.h | 56 ++++++++++ modules/i18n/dao/orm/gen_db_md5.sh | 19 ++++ modules/i18n/dao/orm/i18n_db_definitions | 6 + modules/i18n/dao/orm/i18n_db_sql_generator.h | 27 +++++ modules/{widget_dao => i18n/dao}/orm/iana_db | 0 modules/i18n/dao/orm/orm_generator_i18n.h | 24 ++++ modules/i18n/dao/orm/version_db | 5 + modules/i18n/dao/src/i18n_dao_read_only.cpp | 45 ++++++++ modules/i18n/dao/src/i18n_database.cpp | 43 +++++++ modules/localization/src/w3c_file_localization.cpp | 8 ++ modules/log/config.cmake | 1 + modules/log/include/dpl/log/secure_log.h | 85 ++++++++++++++ .../dao/security_origin_dao.cpp | 8 +- modules/utils/src/mime_type_utils.cpp | 1 + modules/widget_dao/CMakeLists.txt | 4 +- modules/widget_dao/dao/feature_dao.cpp | 6 +- modules/widget_dao/dao/global_dao.cpp | 57 ---------- modules/widget_dao/dao/global_dao_read_only.cpp | 71 +----------- modules/widget_dao/dao/plugin_dao.cpp | 4 +- modules/widget_dao/dao/widget_dao.cpp | 42 ++++--- modules/widget_dao/dao/widget_dao_read_only.cpp | 34 +----- .../include/dpl/wrt-dao-ro/common_dao_types.h | 2 - .../include/dpl/wrt-dao-ro/config_parser_data.h | 2 + .../include/dpl/wrt-dao-ro/global_config.h | 10 -- .../include/dpl/wrt-dao-ro/global_dao_read_only.h | 8 -- .../include/dpl/wrt-dao-ro/widget_dao_read_only.h | 20 +--- .../widget_dao/include/dpl/wrt-dao-rw/global_dao.h | 6 - .../widget_dao/include/dpl/wrt-dao-rw/widget_dao.h | 22 ++-- modules/widget_dao/orm/wrt_db | 3 - modules/widget_dao/orm/wrt_db_definitions | 1 - packaging/wrt-commons.spec | 4 +- tests/CMakeLists.txt | 1 + tests/common/src/loop_control.cpp | 2 +- tests/core/CMakeLists.txt | 1 + tests/core/test_scope_guard.cpp | 124 +++++++++++++++++++++ tests/core/test_thread.cpp | 8 +- tests/dao/TestCases_WidgetDAO.cpp | 21 +--- tests/dao/tests_dao.cpp | 2 +- tests/dbus/main.cpp | 2 +- tests/event/test_event_support.cpp | 2 +- tests/event/test_ic_delegate.cpp | 2 +- tests/i18n/CMakeLists.txt | 40 +++++++ tests/i18n/main.cpp | 28 +++++ tests/i18n/test_i18n_dao_read_only.cpp | 53 +++++++++ .../Localization_testcases.cpp | 12 +- tests/localizationTagsProvider/tests_miscunit.cpp | 2 +- tests/unused/test_message_queue.cpp | 6 +- tests/unused/test_shm.cpp | 24 ++-- tests/unused/test_task.cpp | 6 +- 74 files changed, 1010 insertions(+), 404 deletions(-) create mode 100644 build/i18n/CMakeLists.txt create mode 100644 build/i18n/wrt-commons-i18n-dao-ro.pc.in mode change 100644 => 100755 modules/certificate_dao/dao/certificate_dao.cpp create mode 100644 modules/core/include/dpl/scope_guard.h create mode 100644 modules/i18n/CMakeLists.txt create mode 100644 modules/i18n/dao/CMakeLists.txt create mode 100644 modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_dao_read_only.h create mode 100644 modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_database.h create mode 100755 modules/i18n/dao/orm/gen_db_md5.sh create mode 100644 modules/i18n/dao/orm/i18n_db_definitions create mode 100644 modules/i18n/dao/orm/i18n_db_sql_generator.h rename modules/{widget_dao => i18n/dao}/orm/iana_db (100%) create mode 100644 modules/i18n/dao/orm/orm_generator_i18n.h create mode 100644 modules/i18n/dao/orm/version_db create mode 100644 modules/i18n/dao/src/i18n_dao_read_only.cpp create mode 100644 modules/i18n/dao/src/i18n_database.cpp mode change 100755 => 100644 modules/localization/src/w3c_file_localization.cpp create mode 100644 modules/log/include/dpl/log/secure_log.h mode change 100755 => 100644 modules/security_origin_dao/dao/security_origin_dao.cpp create mode 100644 tests/core/test_scope_guard.cpp create mode 100644 tests/i18n/CMakeLists.txt create mode 100644 tests/i18n/main.cpp create mode 100644 tests/i18n/test_i18n_dao_read_only.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 746e7b7..fe837ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,6 +192,7 @@ SET(TARGET_SECURITY_ORIGIN_DAO_LIB "wrt-commons-security-origin-dao") SET(TARGET_CERTIFICATE_DAO_LIB "wrt-commons-certificate-dao") SET(TARGET_DPL_UTILS_EFL "lib${PROJECT_NAME}-utils-efl") SET(TARGET_DPL_ENCRYPTION "lib${PROJECT_NAME}-encryption") +SET(TARGET_I18N_DAO_RO_LIB "wrt-commons-i18n-dao-ro") macro(configure_and_install_pkg PKG_FILE) CONFIGURE_FILE(${PKG_FILE}.in ${PKG_FILE} @ONLY) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index d151c82..852127c 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -33,3 +33,4 @@ ADD_SUBDIRECTORY(utils) ADD_SUBDIRECTORY(support) ADD_SUBDIRECTORY(encryption) ADD_SUBDIRECTORY(certificate_dao) +ADD_SUBDIRECTORY(i18n) diff --git a/build/i18n/CMakeLists.txt b/build/i18n/CMakeLists.txt new file mode 100644 index 0000000..3d97f54 --- /dev/null +++ b/build/i18n/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @file CMakeLists.txt +# @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) +# @brief +# + +configure_and_install_pkg(wrt-commons-i18n-dao-ro.pc) diff --git a/build/i18n/wrt-commons-i18n-dao-ro.pc.in b/build/i18n/wrt-commons-i18n-dao-ro.pc.in new file mode 100644 index 0000000..270630b --- /dev/null +++ b/build/i18n/wrt-commons-i18n-dao-ro.pc.in @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} + +libdir=${prefix}/lib +includedir=${prefix}/include +Name: wrt-commons-i18n-dao-ro +Description: wrt-commons-i18n-dao-ro + +Version: @VERSION@ +Requires: dpl-efl +Libs: -lwrt-commons-i18n-dao-ro -L${libdir} +Cflags: -I${includedir}/dpl-efl diff --git a/etc/wrt_commons_create_clean_db.sh b/etc/wrt_commons_create_clean_db.sh index bb8d16e..893631c 100755 --- a/etc/wrt_commons_create_clean_db.sh +++ b/etc/wrt_commons_create_clean_db.sh @@ -66,7 +66,7 @@ do create_db $name $DB_PATH done -for name in wrt_custom_handler +for name in wrt_custom_handler wrt_i18n do create_db $name $DB_USER_PATH done diff --git a/examples/dbus/server-example/server-example.cpp b/examples/dbus/server-example/server-example.cpp index a733c70..84e665d 100644 --- a/examples/dbus/server-example/server-example.cpp +++ b/examples/dbus/server-example/server-example.cpp @@ -52,14 +52,14 @@ public: GVariant *parameters, GDBusMethodInvocation *invocation) { - LogInfo("On method call: " << methodName); + LogDebug("On method call: " << methodName); if (g_strcmp0(methodName, "echo") == 0) { const gchar* arg = NULL; g_variant_get(parameters, "(&s)", &arg); - LogInfo("Client said: " << arg); + LogDebug("Client said: " << arg); gchar* response = g_strdup_printf(arg); g_dbus_method_invocation_return_value(invocation, diff --git a/examples/fake_rpc/fake_rpc.cpp b/examples/fake_rpc/fake_rpc.cpp index 82a2443..bab1069 100644 --- a/examples/fake_rpc/fake_rpc.cpp +++ b/examples/fake_rpc/fake_rpc.cpp @@ -67,10 +67,10 @@ private: virtual void OnEventReceived(const AsyncCallEvent &event) { - LogInfo("CLIENT: AsyncCallEvent received"); + LogDebug("CLIENT: AsyncCallEvent received"); event.GetArg0().ConsumeArg(m_receivedData); - LogInfo("CLIENT: Result from server: " << m_receivedData); + LogDebug("CLIENT: Result from server: " << m_receivedData); if (m_receivedData != m_sentData) LogError("Wrong data Received!"); @@ -80,14 +80,14 @@ private: { if (dynamic_cast(event.GetArg1())){ ++m_connections; - LogInfo("CLIENT: Acquiring new fake connection"); + LogDebug("CLIENT: Acquiring new fake connection"); m_rpcFakeConnection.reset(event.GetArg1()); //this is not used on this side // m_rpcFakeConnection->DPL::EventSupport::AddListener(this); } else{ ++m_connections; - LogInfo("CLIENT: Acquiring new unix connection"); + LogDebug("CLIENT: Acquiring new unix connection"); m_rpcUnixConnection.reset(event.GetArg1()); m_rpcUnixConnection->DPL::EventSupport::AddListener(this); } @@ -96,7 +96,7 @@ private: // Emit RPC function call DPL::RPCFunction proc; proc.AppendArg(m_sentData); - LogInfo("CLIENT: Calling RPC function"); + LogDebug("CLIENT: Calling RPC function"); m_rpcFakeConnection->AsyncCall(proc); } } @@ -120,41 +120,41 @@ public: { m_connections = 0; // Attach RPC listeners - LogInfo("CLIENT: Attaching connection established event"); + LogDebug("CLIENT: Attaching connection established event"); m_rpcUnixClient.DPL::EventSupport::AddListener(this); m_rpcFakeClient.DPL::EventSupport::AddListener(this); // Open connection to server - LogInfo("CLIENT: Opening connection to RPC"); + LogDebug("CLIENT: Opening connection to RPC"); m_rpcUnixClient.Open(UNIX_RPC_NAME); m_rpcFakeClient.Open(FAKE_RPC_NAME); // Start message loop - LogInfo("CLIENT: Starting thread event loop"); + LogDebug("CLIENT: Starting thread event loop"); int ret = Exec(); if (m_rpcUnixConnection.get()){ - LogInfo("CLIENT: Removing Unix connection"); + LogDebug("CLIENT: Removing Unix connection"); m_rpcUnixConnection->DPL::EventSupport::RemoveListener(this); m_rpcUnixConnection.reset(); } - LogInfo("CLIENT: Closing"); + LogDebug("CLIENT: Closing"); if (m_rpcFakeConnection.get()){ - LogInfo("CLIENT: Removing Fake connection"); + LogDebug("CLIENT: Removing Fake connection"); //this is not used on this side // m_rpcFakeConnection->DPL::EventSupport::RemoveListener(this); m_rpcFakeConnection.reset(); } // Detach RPC client listener - LogInfo("CLIENT: Detaching connection established event"); + LogDebug("CLIENT: Detaching connection established event"); m_rpcUnixClient.DPL::EventSupport::RemoveListener(this); m_rpcFakeClient.DPL::EventSupport::RemoveListener(this); // Close RPC - LogInfo("CLIENT: Closing RPC client"); + LogDebug("CLIENT: Closing RPC client"); m_rpcUnixClient.CloseAll(); m_rpcFakeClient.Close();//not needed @@ -185,7 +185,7 @@ private: // Quit application event occurred virtual void OnEventReceived(const QuitEvent &/*event*/){ // Close RPC now - LogInfo("SERVER: Closing RPC connection..."); + LogDebug("SERVER: Closing RPC connection..."); // Detach RPC connection listeners if (m_rpcUnixConnection.get()) { @@ -199,13 +199,13 @@ private: m_rpcFakeConnection.reset(); } - LogInfo("SERVER: Closing Server"); + LogDebug("SERVER: Closing Server"); m_rpcUnixServer.CloseAll(); m_rpcFakeServer.CloseAll();//not needed m_rpcUnixServer.DPL::EventSupport::RemoveListener(this); m_rpcFakeServer.DPL::EventSupport::RemoveListener(this); - LogInfo("SERVER: Server closed"); + LogDebug("SERVER: Server closed"); Quit(); } @@ -216,17 +216,17 @@ private: virtual void OnEventReceived(const AsyncCallEvent &event) { - LogInfo("SERVER: AsyncCallEvent received"); + LogDebug("SERVER: AsyncCallEvent received"); int value; event.GetArg0().ConsumeArg(value); - LogInfo("SERVER: Result from client: " << value); + LogDebug("SERVER: Result from client: " << value); // send back data to client (via fake) // Emit RPC function call DPL::RPCFunction proc; proc.AppendArg(value); - LogInfo("SERVER: Calling RPC function"); + LogDebug("SERVER: Calling RPC function"); m_rpcUnixConnection->AsyncCall(proc); } @@ -234,12 +234,12 @@ private: { // Save connection pointer if (dynamic_cast(event.GetArg1())){ - LogInfo("SERVER: Acquiring Fake RPC connection"); + LogDebug("SERVER: Acquiring Fake RPC connection"); m_rpcFakeConnection.reset(event.GetArg1()); m_rpcFakeConnection->DPL::EventSupport::AddListener(this); } else{ - LogInfo("SERVER: Acquiring Unix RPC connection"); + LogDebug("SERVER: Acquiring Unix RPC connection"); m_rpcUnixConnection.reset(event.GetArg1()); //this is not used on this side // m_rpcUnixConnection->DPL::EventSupport::AddListener(this); @@ -251,25 +251,25 @@ public: : Application(argc, argv, "rpc") { // Attach RPC server listeners - LogInfo("SERVER: Attaching connection established event"); + LogDebug("SERVER: Attaching connection established event"); m_rpcUnixServer.DPL::EventSupport::AddListener(this); m_rpcFakeServer.DPL::EventSupport::AddListener(this); // Self touch - LogInfo("SERVER: Touching controller"); + LogDebug("SERVER: Touching controller"); Touch(); // Open RPC server - LogInfo("SERVER: Opening server RPC"); + LogDebug("SERVER: Opening server RPC"); m_rpcUnixServer.Open(UNIX_RPC_NAME); m_rpcFakeServer.Open(FAKE_RPC_NAME); // Run RPC client in thread - LogInfo("SERVER: Starting RPC client thread"); + LogDebug("SERVER: Starting RPC client thread"); m_thread.Run(); // Quit application automatically in few seconds - LogInfo("SERVER: Sending control timed events"); + LogDebug("SERVER: Sending control timed events"); DPL::ControllerEventHandler::PostTimedEvent(CloseThreadEvent(), 2); DPL::ControllerEventHandler::PostTimedEvent(QuitEvent(), 3); } @@ -277,13 +277,13 @@ public: virtual ~MyApplication() { // Quit thread - LogInfo("SERVER: Quitting thread"); + LogDebug("SERVER: Quitting thread"); } }; int main(int argc, char *argv[]) { - LogInfo("Starting"); + LogDebug("Starting"); MyApplication app(argc, argv); return app.Exec(); } diff --git a/examples/metronome/metronome_client.cpp b/examples/metronome/metronome_client.cpp index 4184f54..1fca0df 100644 --- a/examples/metronome/metronome_client.cpp +++ b/examples/metronome/metronome_client.cpp @@ -41,14 +41,14 @@ private: (void)event; // Heart beat - LogInfo("* Got metronome signal *"); + LogDebug("* Got metronome signal *"); } virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::ConnectionClosedEvent &event) { (void)event; - LogInfo("Connection closed"); + LogDebug("Connection closed"); // Must quit Quit(); @@ -58,7 +58,7 @@ private: { (void)event; - LogInfo("Connection broken"); + LogDebug("Connection broken"); // Must quit Quit(); @@ -67,7 +67,7 @@ private: virtual void OnEventReceived(const DPL::AbstractRPCConnectorEvents::ConnectionEstablishedEvent &event) { // Save connection pointer - LogInfo("Connected to metronome server"); + LogDebug("Connected to metronome server"); m_rpcConnection.reset(event.GetArg1()); // Attach event listeners @@ -87,7 +87,7 @@ public: m_rpcClient.Open("127.0.0.1", 12345); // Started - LogInfo("Metronome client started"); + LogDebug("Metronome client started"); } virtual ~MetronomeClientApplication() diff --git a/examples/metronome/metronome_server.cpp b/examples/metronome/metronome_server.cpp index 508f61d..cc0ad0a 100644 --- a/examples/metronome/metronome_server.cpp +++ b/examples/metronome/metronome_server.cpp @@ -103,7 +103,7 @@ private: { (void)event; - LogInfo("Connection closed"); + LogDebug("Connection closed"); // Remove connection from list RemoveConnection(static_cast(event.GetSender())); @@ -113,7 +113,7 @@ private: { (void)event; - LogInfo("Connection broken"); + LogDebug("Connection broken"); // Remove connection from list RemoveConnection(static_cast(event.GetSender())); @@ -122,7 +122,7 @@ private: virtual void OnEventReceived(const DPL::AbstractRPCConnectorEvents::ConnectionEstablishedEvent &event) { // Save connection pointer - LogInfo("New connection"); + LogDebug("New connection"); // Add nre connection to list AddConnection(event.GetArg1()); @@ -145,7 +145,7 @@ public: DPL::ControllerEventHandler::PostTimedEvent(SignalEvent(), HEART_BEAT_INTERVAL); // Started - LogInfo("Metronome server started"); + LogDebug("Metronome server started"); } virtual ~MetronomeServerApplication() diff --git a/examples/rpc/rpc.cpp b/examples/rpc/rpc.cpp index e1e2a64..6991edb 100644 --- a/examples/rpc/rpc.cpp +++ b/examples/rpc/rpc.cpp @@ -47,43 +47,43 @@ private: { (void)event; - LogInfo("CLIENT: AsyncCallEvent received"); + LogDebug("CLIENT: AsyncCallEvent received"); int value; event.GetArg0().ConsumeArg(value); - LogInfo("CLIENT: Result from server: " << value); + LogDebug("CLIENT: Result from server: " << value); } virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::ConnectionClosedEvent &event) { (void)event; - LogInfo("CLIENT: ConnectionClosedEvent received"); + LogDebug("CLIENT: ConnectionClosedEvent received"); } virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::ConnectionBrokenEvent &event) { (void)event; - LogInfo("CLIENT: ConnectionBrokenEvent received"); + LogDebug("CLIENT: ConnectionBrokenEvent received"); } virtual void OnEventReceived(const DPL::AbstractRPCConnectorEvents::ConnectionEstablishedEvent &event) { // Save connection pointer - LogInfo("CLIENT: Acquiring new connection"); + LogDebug("CLIENT: Acquiring new connection"); m_rpcConnection.reset(event.GetArg1()); // Attach listener to new connection - LogInfo("CLIENT: Attaching connection event listeners"); + LogDebug("CLIENT: Attaching connection event listeners"); m_rpcConnection->DPL::EventSupport::AddListener(this); m_rpcConnection->DPL::EventSupport::AddListener(this); m_rpcConnection->DPL::EventSupport::AddListener(this); - LogInfo("CLIENT: Connection established"); + LogDebug("CLIENT: Connection established"); // Emit RPC function call DPL::RPCFunction proc; proc.AppendArg((int)1111); - LogInfo("CLIENT: Calling RPC function"); + LogDebug("CLIENT: Calling RPC function"); m_rpcConnection->AsyncCall(proc); } @@ -97,35 +97,35 @@ public: virtual int ThreadEntry() { // Attach RPC listeners - LogInfo("CLIENT: Attaching connection established event"); + LogDebug("CLIENT: Attaching connection established event"); m_rpcClient.DPL::EventSupport::AddListener(this); // Open connection to server - LogInfo("CLIENT: Opening connection to RPC"); + LogDebug("CLIENT: Opening connection to RPC"); m_rpcClient.Open(RPC_NAME); // Start message loop - LogInfo("CLIENT: Starting thread event loop"); + LogDebug("CLIENT: Starting thread event loop"); int ret = Exec(); // Detach RPC listeners if (m_rpcConnection.get()) { - LogInfo("CLIENT: Detaching RPC connection events"); + LogDebug("CLIENT: Detaching RPC connection events"); m_rpcConnection->DPL::EventSupport::RemoveListener(this); m_rpcConnection->DPL::EventSupport::RemoveListener(this); m_rpcConnection->DPL::EventSupport::RemoveListener(this); - LogInfo("CLIENT: Resetting connection"); + LogDebug("CLIENT: Resetting connection"); m_rpcConnection.reset(); } // Detach RPC client listener - LogInfo("CLIENT: Detaching connection established event"); + LogDebug("CLIENT: Detaching connection established event"); m_rpcClient.DPL::EventSupport::RemoveListener(this); // Close RPC - LogInfo("CLIENT: Closing RPC client"); + LogDebug("CLIENT: Closing RPC client"); m_rpcClient.CloseAll(); // Done @@ -168,61 +168,61 @@ private: { (void)event; - LogInfo("SERVER: AsyncCallEvent received"); + LogDebug("SERVER: AsyncCallEvent received"); int value; event.GetArg0().ConsumeArg(value); - LogInfo("SERVER: Result from client: " << value); + LogDebug("SERVER: Result from client: " << value); } virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::ConnectionClosedEvent &event) { (void)event; - LogInfo("SERVER: ConnectionClosedEvent received"); + LogDebug("SERVER: ConnectionClosedEvent received"); // Close RPC now - LogInfo("SERVER: Closing RPC connection on event..."); + LogDebug("SERVER: Closing RPC connection on event..."); // Detach RPC connection listeners if (m_rpcConnection.get()) { - LogInfo("SERVER: Detaching connection events"); + LogDebug("SERVER: Detaching connection events"); m_rpcConnection->DPL::EventSupport::RemoveListener(this); m_rpcConnection->DPL::EventSupport::RemoveListener(this); m_rpcConnection->DPL::EventSupport::RemoveListener(this); } - LogInfo("SERVER: RPC connection closed"); + LogDebug("SERVER: RPC connection closed"); - LogInfo("SERVER: Closing RPC on event..."); + LogDebug("SERVER: Closing RPC on event..."); m_rpcServer.CloseAll(); - LogInfo("SERVER: RPC closed"); + LogDebug("SERVER: RPC closed"); } virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::ConnectionBrokenEvent &event) { (void)event; - LogInfo("SERVER: ConnectionBrokenEvent received"); + LogDebug("SERVER: ConnectionBrokenEvent received"); } virtual void OnEventReceived(const DPL::AbstractRPCConnectorEvents::ConnectionEstablishedEvent &event) { // Save connection pointer - LogInfo("SERVER: Acquiring RPC connection"); + LogDebug("SERVER: Acquiring RPC connection"); m_rpcConnection.reset(event.GetArg1()); // Attach event listeners - LogInfo("SERVER: Attaching connection listeners"); + LogDebug("SERVER: Attaching connection listeners"); m_rpcConnection->DPL::EventSupport::AddListener(this); m_rpcConnection->DPL::EventSupport::AddListener(this); m_rpcConnection->DPL::EventSupport::AddListener(this); - LogInfo("SERVER: Connection established"); + LogDebug("SERVER: Connection established"); // Emit RPC function call DPL::RPCFunction proc; proc.AppendArg((int)2222); - LogInfo("SERVER: Calling RPC function"); + LogDebug("SERVER: Calling RPC function"); m_rpcConnection->AsyncCall(proc); } @@ -231,23 +231,23 @@ public: : Application(argc, argv, "rpc") { // Attach RPC server listeners - LogInfo("SERVER: Attaching connection established event"); + LogDebug("SERVER: Attaching connection established event"); m_rpcServer.DPL::EventSupport::AddListener(this); // Self touch - LogInfo("SERVER: Touching controller"); + LogDebug("SERVER: Touching controller"); Touch(); // Open RPC server - LogInfo("SERVER: Opening server RPC"); + LogDebug("SERVER: Opening server RPC"); m_rpcServer.Open(RPC_NAME); // Run RPC client in thread - LogInfo("SERVER: Starting RPC client thread"); + LogDebug("SERVER: Starting RPC client thread"); m_thread.Run(); // Quit application automatically in few seconds - LogInfo("SERVER: Sending control timed events"); + LogDebug("SERVER: Sending control timed events"); DPL::ControllerEventHandler::PostTimedEvent(CloseThreadEvent(), 2); DPL::ControllerEventHandler::PostTimedEvent(QuitEvent(), 3); } @@ -255,11 +255,11 @@ public: virtual ~MyApplication() { // Quit thread - LogInfo("SERVER: Quitting thread"); + LogDebug("SERVER: Quitting thread"); m_thread.Quit(); // Close RPC server - LogInfo("SERVER: Closing RPC server"); + LogDebug("SERVER: Closing RPC server"); m_rpcServer.CloseAll(); // Detach RPC server listener @@ -269,7 +269,7 @@ public: int main(int argc, char *argv[]) { - LogInfo("Starting"); + LogDebug("Starting"); MyApplication app(argc, argv); return app.Exec(); } diff --git a/examples/simple/simple.cpp b/examples/simple/simple.cpp index 6da8409..2ed9fab 100644 --- a/examples/simple/simple.cpp +++ b/examples/simple/simple.cpp @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { (void)argc; (void)argv; - LogInfo("Hello world!"); + LogDebug("Hello world!"); return 0; } diff --git a/examples/socket/socket.cpp b/examples/socket/socket.cpp index fca68ab..fc42632 100644 --- a/examples/socket/socket.cpp +++ b/examples/socket/socket.cpp @@ -46,12 +46,12 @@ private: virtual void OnEventReceived(const DPL::AbstractSocketEvents::AcceptEvent &event) { (void)event; - LogInfo("Accept event occurred"); + LogDebug("Accept event occurred"); DPL::UnixSocket *client = static_cast(m_socket.Accept()); - LogInfo("Accepted client remote address: " << client->GetRemoteAddress().ToString()); - LogInfo("Accepted client local address: " << client->GetLocalAddress().ToString()); + LogDebug("Accepted client remote address: " << client->GetRemoteAddress().ToString()); + LogDebug("Accepted client local address: " << client->GetLocalAddress().ToString()); delete client; } @@ -69,14 +69,14 @@ public: m_socket.DPL::EventSupport::AddListener(this); // Create server - LogInfo("Starting server..."); + LogDebug("Starting server..."); m_socket.Bind(DPL::Address(SOCKET_NAME)); m_socket.Listen(5); - LogInfo("Server started"); + LogDebug("Server started"); - LogInfo("Server local address: " << m_socket.GetLocalAddress().ToString()); + LogDebug("Server local address: " << m_socket.GetLocalAddress().ToString()); int result = Exec(); @@ -112,7 +112,7 @@ private: virtual void OnEventReceived(const DPL::AbstractSocketEvents::ConnectedEvent &event) { (void)event; - LogInfo("Connected event occurred"); + LogDebug("Connected event occurred"); } public: @@ -126,12 +126,12 @@ public: Touch(); // Start threaded server - LogInfo("Running threaded server"); + LogDebug("Running threaded server"); // Run server in thread thread.Run(); - LogInfo("Waiting for server to start..."); + LogDebug("Waiting for server to start..."); sleep(1); // Connect to server diff --git a/examples/tcpsock/tcpsock.cpp b/examples/tcpsock/tcpsock.cpp index 1bae958..57141ca 100644 --- a/examples/tcpsock/tcpsock.cpp +++ b/examples/tcpsock/tcpsock.cpp @@ -41,7 +41,7 @@ private: virtual void OnEventReceived(const DPL::AbstractSocketEvents::ConnectedEvent &event) { (void)event; - LogInfo("Connected!"); + LogDebug("Connected!"); // Send request DPL::BinaryQueue data; @@ -53,7 +53,7 @@ private: virtual void OnEventReceived(const DPL::AbstractSocketEvents::ReadEvent &event) { (void)event; - LogInfo("Read!"); + LogDebug("Read!"); DPL::BinaryQueueAutoPtr data = m_socket.Read(100); // Bad: DLOG cannot log more than about 450 bytes... @@ -61,7 +61,7 @@ private: if (data->Empty()) { - LogInfo("Connection closed!"); + LogDebug("Connection closed!"); m_socket.Close(); // Done @@ -82,7 +82,7 @@ public: MyApplication(int argc, char **argv) : Application(argc, argv, "tcpsock") { - LogInfo("CTOR!"); + LogDebug("CTOR!"); // Add listeners m_socket.DPL::EventSupport::AddListener(this); @@ -90,13 +90,13 @@ public: // Connect m_socket.Open(); - LogInfo("Connecting..."); + LogDebug("Connecting..."); m_socket.Connect(DPL::Address("en.wikipedia.org", 80)); } virtual ~MyApplication() { - LogInfo("DTOR!"); + LogDebug("DTOR!"); // Remove listeners m_socket.DPL::EventSupport::RemoveListener(this); diff --git a/examples/timed_event/timed_event.cpp b/examples/timed_event/timed_event.cpp index 4e32cef..f3d8e80 100644 --- a/examples/timed_event/timed_event.cpp +++ b/examples/timed_event/timed_event.cpp @@ -39,13 +39,13 @@ protected: virtual void OnEventReceived(const FirstEvent &event) { (void)event; - LogInfo("First event occurred"); + LogDebug("First event occurred"); } virtual void OnEventReceived(const SecondEvent &event) { (void)event; - LogInfo("Second event occurred"); + LogDebug("Second event occurred"); } }; diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 20f132c..4467c2c 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -31,6 +31,7 @@ ADD_SUBDIRECTORY(widget_dao) ADD_SUBDIRECTORY(security_origin_dao) ADD_SUBDIRECTORY(custom_handler_dao) ADD_SUBDIRECTORY(certificate_dao) +ADD_SUBDIRECTORY(i18n) include(utils/config.cmake) include(localization/config.cmake) include(support/config.cmake) diff --git a/modules/certificate_dao/dao/certificate_dao.cpp b/modules/certificate_dao/dao/certificate_dao.cpp old mode 100644 new mode 100755 index d5506eb..877d5a8 --- a/modules/certificate_dao/dao/certificate_dao.cpp +++ b/modules/certificate_dao/dao/certificate_dao.cpp @@ -85,7 +85,7 @@ void checkDatabase(std::string databasePath) struct stat buffer; if (stat(databasePath.c_str(), &buffer) != 0) { //Create fresh database - LogInfo("Creating database " << databasePath); + LogDebug("Creating database " << databasePath); std::fstream file; file.open(CERTIFICATE_DB_SQL_PATH, std::ios_base::in); diff --git a/modules/core/config.cmake b/modules/core/config.cmake index b929c35..35bbbf3 100644 --- a/modules/core/config.cmake +++ b/modules/core/config.cmake @@ -110,6 +110,7 @@ SET(DPL_CORE_HEADERS ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/preprocessor.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/read_write_mutex.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/recursive_mutex.h + ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/scope_guard.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/scoped_resource.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/scoped_array.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/scoped_close.h diff --git a/modules/core/include/dpl/preprocessor.h b/modules/core/include/dpl/preprocessor.h index 0118d76..6fca34c 100644 --- a/modules/core/include/dpl/preprocessor.h +++ b/modules/core/include/dpl/preprocessor.h @@ -26,4 +26,10 @@ #define DPL_MACRO_CONCAT_IMPL(x, y) x##y #define DPL_MACRO_CONCAT(x, y) DPL_MACRO_CONCAT_IMPL(x, y) +#ifdef __COUNTER__ +#define DPL_ANONYMOUS_VARIABLE(name) DPL_MACRO_CONCAT(name, __COUNTER__) +#else +#define DPL_ANONYMOUS_VARIABLE(name) DPL_MACRO_CONCAT(name, __LINE__) +#endif + #endif //DPL_PREPROCESSOR_H diff --git a/modules/core/include/dpl/scope_guard.h b/modules/core/include/dpl/scope_guard.h new file mode 100644 index 0000000..2471937 --- /dev/null +++ b/modules/core/include/dpl/scope_guard.h @@ -0,0 +1,109 @@ +/* + * Copyright 2013 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/*! + * @file scope_guard.h + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief This file is the implementation file of scope guard RAII + */ +#ifndef DPL_SCOPE_GUARD_H_ +#define DPL_SCOPE_GUARD_H_ + +#include +#include +#include +#include +#include + +namespace DPL { +template +class ScopeGuard +{ + public: + explicit ScopeGuard(const FunctionType& function) + : m_function{function}, + m_released{false} + {} + + explicit ScopeGuard(FunctionType&& function) + : m_function{std::move(function)}, + m_released{false} + {} + + ScopeGuard(ScopeGuard&& other) + : m_function{std::move(other.m_function)}, + m_released{other.m_released} + { + other.Release(); + } + + ScopeGuard(const ScopeGuard&) = delete; + + ~ScopeGuard() + { + if (!m_released) + { + Execute(); + } + } + + ScopeGuard& operator=(const ScopeGuard&) = delete; + + void Release() + { + m_released = true; + } + + void* operator new(size_t) = delete; + + private: + // FIXME change to noexcept when available + void Execute() throw() + { + m_function(); + } + + FunctionType m_function; + bool m_released; +}; + +template +ScopeGuard::type> +MakeScopeGuard(FunctionType&& function) +{ + return ScopeGuard::type>( + std::forward(function)); +} + +namespace detail { +enum class ScopeGuardOnExit {}; + +template +ScopeGuard::type> +operator+(detail::ScopeGuardOnExit, FunctionType&& function) +{ + return ScopeGuard::type>( + std::forward(function)); +} +} +} + +// FIXME provide support for compilers not supporting variadic macros +#define DPL_SCOPE_EXIT(...) \ + auto DPL_ANONYMOUS_VARIABLE(DPL_SCOPE_EXIT_STATE) \ + = ::DPL::detail::ScopeGuardOnExit() + [__VA_ARGS__]() + +#endif // DPL_SCOPE_GUARD_H_ diff --git a/modules/db/include/dpl/db/thread_database_support.h b/modules/db/include/dpl/db/thread_database_support.h index 52cfb33..02d796f 100644 --- a/modules/db/include/dpl/db/thread_database_support.h +++ b/modules/db/include/dpl/db/thread_database_support.h @@ -97,7 +97,7 @@ class ThreadDatabaseSupport : } // Destroy connection - LogInfo("Destroying thread database connection: " << m_address); + LogDebug("Destroying thread database connection: " << m_address); delete *Connection(); @@ -157,7 +157,7 @@ class ThreadDatabaseSupport : } // Initialize SQL connection described in traits - LogInfo("Attaching thread database connection: " << m_address); + LogDebug("Attaching thread database connection: " << m_address); Connection() = new DPL::DB::SqlConnection( m_address.c_str(), m_flags, options); @@ -194,7 +194,7 @@ class ThreadDatabaseSupport : // It must not be in linger state yet Assert(*Linger() == false); - LogInfo("Detaching thread database connection: " << m_address); + LogDebug("Detaching thread database connection: " << m_address); // Enter linger state *Linger() = true; diff --git a/modules/dbus/include/dpl/dbus/dbus_interface_dispatcher.h b/modules/dbus/include/dpl/dbus/dbus_interface_dispatcher.h index ec1b06b..97d7407 100644 --- a/modules/dbus/include/dpl/dbus/dbus_interface_dispatcher.h +++ b/modules/dbus/include/dpl/dbus/dbus_interface_dispatcher.h @@ -81,7 +81,7 @@ class InterfaceDispatcher : public DBus::Dispatcher const gchar* /*interfaceName*/, const gchar* propertyName) { - LogInfo("InterfaceDispatcher onPropertyGet: " << propertyName); + LogDebug("InterfaceDispatcher onPropertyGet: " << propertyName); return NULL; } @@ -92,7 +92,7 @@ class InterfaceDispatcher : public DBus::Dispatcher const gchar* propertyName, GVariant* /*value*/) { - LogInfo("InterfaceDispatcher onPropertySet: " << propertyName); + LogDebug("InterfaceDispatcher onPropertySet: " << propertyName); return false; } diff --git a/modules/dbus/src/server.cpp b/modules/dbus/src/server.cpp index 421090f..a71e4bd 100644 --- a/modules/dbus/src/server.cpp +++ b/modules/dbus/src/server.cpp @@ -80,7 +80,7 @@ void Server::start() G_CALLBACK(onNewConnection), this); - LogInfo("Server started at: " + LogDebug("Server started at: " << g_dbus_server_get_client_address(m_server)); } @@ -102,7 +102,7 @@ gboolean Server::onNewConnection(GDBusServer* /*server*/, ServerEvents::NewConnectionEvent event( ConnectionPtr(new Connection(connection))); - LogInfo("Emitting new connection event"); + LogDebug("Emitting new connection event"); // TODO Blocking to allow object registration before any DBus messages are // processed. self->DPL::Event::EventSupport:: diff --git a/modules/i18n/CMakeLists.txt b/modules/i18n/CMakeLists.txt new file mode 100644 index 0000000..9b1b175 --- /dev/null +++ b/modules/i18n/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(dao) diff --git a/modules/i18n/dao/CMakeLists.txt b/modules/i18n/dao/CMakeLists.txt new file mode 100644 index 0000000..c7b5ada --- /dev/null +++ b/modules/i18n/dao/CMakeLists.txt @@ -0,0 +1,59 @@ +SET(TARGET_I18N_DAO_DB "Sqlite3DbI18n") + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_BINARY_DIR}/modules/i18n/dao/database_checksum_i18n.h + COMMAND ${CMAKE_SOURCE_DIR}/modules/i18n/dao/orm/gen_db_md5.sh + ARGS ${CMAKE_BINARY_DIR}/modules/i18n/dao/database_checksum_i18n.h + ${CMAKE_SOURCE_DIR}/modules/i18n/dao/orm/iana_db + DEPENDS ${CMAKE_SOURCE_DIR}/modules/i18n/dao/orm/iana_db + ${CMAKE_SOURCE_DIR}/modules/i18n/dao/orm/gen_db_md5.sh + COMMENT "Generating WRT i18n database checksum" + ) + +ADD_CUSTOM_COMMAND( OUTPUT .wrt_i18n.db + COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_i18n.db + COMMAND gcc -Wall -include ${CMAKE_BINARY_DIR}/modules/i18n/dao/database_checksum_i18n.h -I${PROJECT_SOURCE_DIR}/modules/db/include -I${PROJECT_SOURCE_DIR}/modules/i18n/dao/orm -E ${PROJECT_SOURCE_DIR}/modules/i18n/dao/orm/i18n_db_sql_generator.h | grep --invert-match "^#" > ${CMAKE_CURRENT_BINARY_DIR}/wrt_i18n_db.sql + COMMAND sqlite3 ${CMAKE_CURRENT_BINARY_DIR}/.wrt_i18n.db ".read ${CMAKE_CURRENT_BINARY_DIR}/wrt_i18n_db.sql" || rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_i18n.db + DEPENDS ${CMAKE_BINARY_DIR}/modules/i18n/dao/database_checksum_i18n.h ${PROJECT_SOURCE_DIR}/modules/i18n/dao/orm/i18n_db_sql_generator.h ${PROJECT_SOURCE_DIR}/modules/i18n/dao/orm/iana_db + ) + +ADD_CUSTOM_COMMAND( OUTPUT .wrt_i18n.db-journal + COMMAND touch + ARGS ${CMAKE_CURRENT_BINARY_DIR}/.wrt_i18n.db-journal + ) + +ADD_CUSTOM_TARGET(${TARGET_I18N_DAO_DB} ALL DEPENDS .wrt_i18n.db .wrt_i18n.db-journal) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wrt_i18n_db.sql DESTINATION share/wrt-engine/) + +############################################################################### + +SET(I18N_DAO_INCLUDE_DIRS + ${PROJECT_SOURCE_DIR}/modules/i18n/dao/include + ${PROJECT_SOURCE_DIR}/modules/i18n/dao/orm + ${PROJECT_SOURCE_DIR}/modules/core/include + ${PROJECT_SOURCE_DIR}/modules/db/include + ${PROJECT_SOURCE_DIR}/modules/log/include +) + + +SET(I18N_DAO_RO_SOURCES + src/i18n_database.cpp + src/i18n_dao_read_only.cpp +) + +INCLUDE_DIRECTORIES(${I18N_DAO_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(SYSTEM ${I18N_DAO_DEPS_INCLUDE_DIRS}) + +ADD_LIBRARY(${TARGET_I18N_DAO_RO_LIB} SHARED ${I18N_DAO_RO_SOURCES}) +SET_TARGET_PROPERTIES(${TARGET_I18N_DAO_RO_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION}) +SET_TARGET_PROPERTIES(${TARGET_I18N_DAO_RO_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/i18n/dao/database_checksum_i18n.h") +TARGET_LINK_LIBRARIES(${TARGET_I18N_DAO_RO_LIB} ${TARGET_DPL_DB_EFL}) +ADD_DEPENDENCIES(${TARGET_I18N_DAO_RO_LIB} ${TARGET_I18N_DAO_DB}) + +INSTALL(TARGETS ${TARGET_I18N_DAO_RO_LIB} DESTINATION lib) + +INSTALL(FILES + include/wrt-commons/i18n-dao-ro/i18n_database.h + include/wrt-commons/i18n-dao-ro/i18n_dao_read_only.h + DESTINATION include/dpl-efl/wrt-commons/i18n-dao-ro +) diff --git a/modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_dao_read_only.h b/modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_dao_read_only.h new file mode 100644 index 0000000..7e8ef9d --- /dev/null +++ b/modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_dao_read_only.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * This file contains the declaration of i18n dao namespace. + * + * @file i18n_dao_read_only.h + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief This file contains the declaration of i18n dao. + */ + +#ifndef _I18N_DAO_READ_ONLY_H_ +#define _I18N_DAO_READ_ONLY_H_ + +#include + +namespace I18n { +namespace DB { +namespace I18nDAOReadOnly { +bool IsValidSubTag(const DPL::String& tag, int type); +} // namespace I18nDAOReadOnly +} // namespace DB +} // namespace I18n + +#endif // _I18N_DAO_READ_ONLY_H_ + diff --git a/modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_database.h b/modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_database.h new file mode 100644 index 0000000..3492f63 --- /dev/null +++ b/modules/i18n/dao/include/wrt-commons/i18n-dao-ro/i18n_database.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _I18N_DATABASE_H_ +#define _I18N_DATABASE_H_ + +#include +#include +#include + +namespace I18n { +namespace DB { +namespace Interface { +void attachDatabaseRO(); +void detachDatabase(); + +extern DPL::Mutex g_dbQueriesMutex; +extern DPL::DB::ThreadDatabaseSupport g_dbInterface; +} // namespace Interface +} // namespace DB +} // namespace I18n + +#define I18N_DB_INTERNAL(tlsCommand, InternalType) \ + static DPL::ThreadLocalVariable *tlsCommand##Ptr = NULL; \ + { \ + DPL::Mutex::ScopedLock lock( \ + &I18n::DB::Interface::g_dbQueriesMutex); \ + if (!tlsCommand##Ptr) { \ + static DPL::ThreadLocalVariable tmp; \ + tlsCommand##Ptr = &tmp; \ + } \ + } \ + DPL::ThreadLocalVariable &tlsCommand = *tlsCommand##Ptr; \ + if (tlsCommand.IsNull()) \ + { \ + tlsCommand = InternalType(&I18n::DB::Interface::g_dbInterface); \ + } + +#define I18N_DB_SELECT(name, type) \ + I18N_DB_INTERNAL(name, type::Select) + +#endif /* _I18N_DATABASE_H_ */ + diff --git a/modules/i18n/dao/orm/gen_db_md5.sh b/modules/i18n/dao/orm/gen_db_md5.sh new file mode 100755 index 0000000..22c2530 --- /dev/null +++ b/modules/i18n/dao/orm/gen_db_md5.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +CHECKSUM=`cat ${2} ${3} 2>/dev/null | md5sum 2>/dev/null | cut -d\ -f1 2>/dev/null` +echo "#define DB_CHECKSUM DB_VERSION_${CHECKSUM}" > ${1} +echo "#define DB_CHECKSUM_STR \"DB_VERSION_${CHECKSUM}\"" >> ${1} + diff --git a/modules/i18n/dao/orm/i18n_db_definitions b/modules/i18n/dao/orm/i18n_db_definitions new file mode 100644 index 0000000..ee94c0a --- /dev/null +++ b/modules/i18n/dao/orm/i18n_db_definitions @@ -0,0 +1,6 @@ +DATABASE_START(i18n) + +#include "iana_db" +#include "version_db" + +DATABASE_END() diff --git a/modules/i18n/dao/orm/i18n_db_sql_generator.h b/modules/i18n/dao/orm/i18n_db_sql_generator.h new file mode 100644 index 0000000..d8f326d --- /dev/null +++ b/modules/i18n/dao/orm/i18n_db_sql_generator.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * @file i18n_db_sql_generator.h + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief Macro definitions for generating the SQL + * input file from database definition. + */ + +//Do not include this file directly! It is used only for SQL code generation. +#include + +#include "i18n_db_definitions" diff --git a/modules/widget_dao/orm/iana_db b/modules/i18n/dao/orm/iana_db similarity index 100% rename from modules/widget_dao/orm/iana_db rename to modules/i18n/dao/orm/iana_db diff --git a/modules/i18n/dao/orm/orm_generator_i18n.h b/modules/i18n/dao/orm/orm_generator_i18n.h new file mode 100644 index 0000000..53cfea3 --- /dev/null +++ b/modules/i18n/dao/orm/orm_generator_i18n.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ORM_GENERATOR_I18N_H_ +#define _ORM_GENERATOR_I18N_H_ + +#define ORM_GENERATOR_DATABASE_NAME i18n_db_definitions +#include +#undef ORM_GENERATOR_DATABASE_NAME + +#endif // _ORM_GENERATOR_I18N_H_ diff --git a/modules/i18n/dao/orm/version_db b/modules/i18n/dao/orm/version_db new file mode 100644 index 0000000..7e20d8d --- /dev/null +++ b/modules/i18n/dao/orm/version_db @@ -0,0 +1,5 @@ +SQL( + BEGIN TRANSACTION; + CREATE TABLE DB_CHECKSUM (version INT); + COMMIT; +) diff --git a/modules/i18n/dao/src/i18n_dao_read_only.cpp b/modules/i18n/dao/src/i18n_dao_read_only.cpp new file mode 100644 index 0000000..19822ff --- /dev/null +++ b/modules/i18n/dao/src/i18n_dao_read_only.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * This file contains the definition of i18n dao namespace. + * + * @file i18n_dao_read_only.cpp + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief This file contains the definition of i18n dao + */ + +#include +#include + +#include + +using namespace DPL::DB::ORM; +using namespace DPL::DB::ORM::i18n; + +namespace I18n { +namespace DB { +namespace I18nDAOReadOnly { +bool IsValidSubTag(const DPL::String& tag, int type) +{ + I18N_DB_SELECT(select, iana_records) + select->Where(And(Equals(tag), + Equals(type))); + return !select->GetRowList().empty(); +} +} +} +} diff --git a/modules/i18n/dao/src/i18n_database.cpp b/modules/i18n/dao/src/i18n_database.cpp new file mode 100644 index 0000000..e1a1fc5 --- /dev/null +++ b/modules/i18n/dao/src/i18n_database.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +namespace I18n { +namespace DB { +namespace Interface { +namespace { +const char* const I18N_DB_FILE_PATH = "/opt/usr/dbspace/.wrt_i18n.db"; + +DPL::DB::SqlConnection::Flag::Type I18N_DB_FLAGS = + DPL::DB::SqlConnection::Flag::UseLucene; +} + +DPL::Mutex g_dbQueriesMutex; +DPL::DB::ThreadDatabaseSupport g_dbInterface(I18N_DB_FILE_PATH, + I18N_DB_FLAGS); + +void attachDatabaseRO() +{ + g_dbInterface.AttachToThread(DPL::DB::SqlConnection::Flag::RO); +} + +void detachDatabase() +{ + g_dbInterface.DetachFromThread(); +} +} //namespace Interface +} //namespace DB +} //namespace I18n diff --git a/modules/localization/src/w3c_file_localization.cpp b/modules/localization/src/w3c_file_localization.cpp old mode 100755 new mode 100644 index 66865ba..46c4194 --- a/modules/localization/src/w3c_file_localization.cpp +++ b/modules/localization/src/w3c_file_localization.cpp @@ -149,6 +149,7 @@ std::string getFilePathInWidgetPackageFromUrl(const std::string &tzAppId, const const std::string SCHEME_WIDGET = "widget://"; const std::string SCHEM_APP = "app://"; const std::string LOCALE_PATH = "locales/"; + const std::string DOUBLE_ROOT = "//"; static std::string lastTzAppId; static WidgetDAOReadOnlyPtr dao; @@ -186,6 +187,13 @@ std::string getFilePathInWidgetPackageFromUrl(const std::string &tzAppId, const // remove "file://" workingUrl.erase(0, SCHEME_FILE.length()); + // exception handling for "//" + if (workingUrl.compare(0, DOUBLE_ROOT.length(), DOUBLE_ROOT) == 0) + { + workingUrl.erase(0, 1); + LogDebug("workingUrl: " << workingUrl); + } + // remove src path if (workingUrl.compare(0, srcPath.length(), srcPath) == 0) { diff --git a/modules/log/config.cmake b/modules/log/config.cmake index 26e35f6..30ad033 100644 --- a/modules/log/config.cmake +++ b/modules/log/config.cmake @@ -32,6 +32,7 @@ SET(DPL_LOG_HEADERS ${PROJECT_SOURCE_DIR}/modules/log/include/dpl/log/dlog_log_provider.h ${PROJECT_SOURCE_DIR}/modules/log/include/dpl/log/log.h ${PROJECT_SOURCE_DIR}/modules/log/include/dpl/log/old_style_log_provider.h + ${PROJECT_SOURCE_DIR}/modules/log/include/dpl/log/secure_log.h PARENT_SCOPE ) diff --git a/modules/log/include/dpl/log/secure_log.h b/modules/log/include/dpl/log/secure_log.h new file mode 100644 index 0000000..9d5fb43 --- /dev/null +++ b/modules/log/include/dpl/log/secure_log.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file secure_log.h + * @author Jihoon Chung(jihoon.chung@samsung.com) + * @version 0.1 + * @brief + */ + +#ifndef DPL_SECURE_LOG_H +#define DPL_SECURE_LOG_H + +#include + +#define COLOR_ERROR "\e[1;31m" +#define COLOR_WARNING "\e[2;31m" +#define COLOR_END "\e[0m" +#define COLOR_TAG "\e[0m" + +#ifdef WRT_LOG +#undef LOG_TAG +#define LOG_TAG "WRT" +#undef COLOR_TAG +#define COLOR_TAG "\e[1;32m" +#endif + +#ifdef WRT_BUNDLE_LOG +#undef LOG_TAG +#define LOG_TAG "WRT_BUNDLE" +#undef COLOR_TAG +#define COLOR_TAG "\e[1;34m" +#endif + +#ifdef WRT_PLUGINS_COMMON_LOG +#undef LOG_TAG +#define LOG_TAG "WRT_PLUGINS/COMMON" +#undef COLOR_TAG +#define COLOR_TAG "\e[1;36m" +#endif + +#ifdef WRT_PLUGINS_WIDGET_LOG +#undef LOG_TAG +#define LOG_TAG "WRT_PLUGINS/WIDGET" +#undef COLOR_TAG +#define COLOR_TAG "\e[1;35m" +#endif + +#ifdef WRT_INSTALLER_LOG +#undef LOG_TAG +#define LOG_TAG "WRT_INSTALLER" +#undef COLOR_TAG +#define COLOR_TAG "\e[1;32m" +#endif + +#ifndef SECURE_SLOGD +#define SECURE_SLOGD(fmt, arg...) SLOGD(fmt,##arg) +#endif + +#ifndef SECURE_SLOGW +#define SECURE_SLOGW(fmt, arg...) SLOGW(fmt,##arg) +#endif + +#ifndef SECURE_SLOGE +#define SECURE_SLOGE(fmt, arg...) SLOGE(fmt,##arg) +#endif + +#define _D(fmt, arg ...) SECURE_SLOGD(COLOR_TAG fmt COLOR_END,##arg) +#define _W(fmt, arg ...) SECURE_SLOGW(COLOR_WARNING fmt COLOR_END,##arg) +#define _E(fmt, arg ...) SECURE_SLOGE(COLOR_ERROR fmt COLOR_END,##arg) + +#endif // DPL_SECURE_LOG_H + diff --git a/modules/security_origin_dao/dao/security_origin_dao.cpp b/modules/security_origin_dao/dao/security_origin_dao.cpp old mode 100755 new mode 100644 index 0293898..1e2e1f2 --- a/modules/security_origin_dao/dao/security_origin_dao.cpp +++ b/modules/security_origin_dao/dao/security_origin_dao.cpp @@ -83,7 +83,7 @@ void checkDatabase(std::string databasePath) struct stat buffer; if (stat(databasePath.c_str(), &buffer) != 0) { //Create fresh database - LogInfo("Creating database " << databasePath); + LogDebug("Creating database " << databasePath); std::fstream file; file.open(SECURITY_ORIGIN_DB_SQL_PATH, std::ios_base::in); @@ -228,6 +228,10 @@ void SecurityOriginDAO::setSecurityOriginData(const SecurityOriginData &security SECURITY_ORIGIN_DB_UPDATE(update, SecurityOriginInfo, &m_securityOriginDBInterface); + update->Where(And(And(And(Equals(securityOriginData.feature), + Equals(securityOriginData.origin.scheme)), + Equals(securityOriginData.origin.host)), + Equals(securityOriginData.origin.port))); update->Values(row); update->Execute(); } else { @@ -246,7 +250,7 @@ void SecurityOriginDAO::setSecurityOriginData(const SecurityOriginData &security void SecurityOriginDAO::setPrivilegeSecurityOriginData(const Feature feature, bool isOnlyAllowedLocalOrigin) { - Origin origin(DPL::FromUTF8String("file"), + Origin origin(DPL::FromUTF8String("file"), //TODO: this breaks app:// scheme code -> no case for app scheme DPL::FromUTF8String(""), 0); if (!isOnlyAllowedLocalOrigin) { diff --git a/modules/utils/src/mime_type_utils.cpp b/modules/utils/src/mime_type_utils.cpp index 1dbe832..a51df5e 100644 --- a/modules/utils/src/mime_type_utils.cpp +++ b/modules/utils/src/mime_type_utils.cpp @@ -43,6 +43,7 @@ const std::set& MimeTypeUtils::getMimeTypesSupportedForStartFile() if (set.empty()) { set.insert(s("text/html")); set.insert(s("application/xhtml+xml")); + set.insert(s("image/svg+xml")); } return set; } diff --git a/modules/widget_dao/CMakeLists.txt b/modules/widget_dao/CMakeLists.txt index d62ee17..141a29f 100755 --- a/modules/widget_dao/CMakeLists.txt +++ b/modules/widget_dao/CMakeLists.txt @@ -5,9 +5,7 @@ ADD_CUSTOM_COMMAND( COMMAND ${CMAKE_SOURCE_DIR}/modules/widget_dao/orm/gen_db_md5.sh ARGS ${CMAKE_BINARY_DIR}/modules/widget_dao/database_checksum.h ${CMAKE_SOURCE_DIR}/modules/widget_dao/orm/wrt_db - ${CMAKE_SOURCE_DIR}/modules/widget_dao/orm/iana_db DEPENDS ${CMAKE_SOURCE_DIR}/modules/widget_dao/orm/wrt_db - ${CMAKE_SOURCE_DIR}/modules/widget_dao/orm/iana_db ${CMAKE_SOURCE_DIR}/modules/widget_dao/orm/gen_db_md5.sh COMMENT "Generating WRT database checksum" ) @@ -16,7 +14,7 @@ ADD_CUSTOM_COMMAND( OUTPUT .wrt.db COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt.db COMMAND gcc -Wall -include ${CMAKE_BINARY_DIR}/modules/widget_dao/database_checksum.h -I${PROJECT_SOURCE_DIR}/modules/db/include -I${PROJECT_SOURCE_DIR}/modules/widget_dao/orm -E ${PROJECT_SOURCE_DIR}/modules/widget_dao/orm/wrt_db_sql_generator.h | grep --invert-match "^#" > ${CMAKE_CURRENT_BINARY_DIR}/wrt_db.sql COMMAND sqlite3 ${CMAKE_CURRENT_BINARY_DIR}/.wrt.db ".read ${CMAKE_CURRENT_BINARY_DIR}/wrt_db.sql" || rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt.db - DEPENDS ${CMAKE_BINARY_DIR}/modules/widget_dao/database_checksum.h ${PROJECT_SOURCE_DIR}/modules/widget_dao/orm/wrt_db_sql_generator.h ${PROJECT_SOURCE_DIR}/modules/widget_dao/orm/wrt_db ${PROJECT_SOURCE_DIR}/modules/widget_dao/orm/iana_db + DEPENDS ${CMAKE_BINARY_DIR}/modules/widget_dao/database_checksum.h ${PROJECT_SOURCE_DIR}/modules/widget_dao/orm/wrt_db_sql_generator.h ${PROJECT_SOURCE_DIR}/modules/widget_dao/orm/wrt_db ) ADD_CUSTOM_COMMAND( OUTPUT .wrt.db-journal diff --git a/modules/widget_dao/dao/feature_dao.cpp b/modules/widget_dao/dao/feature_dao.cpp index ba12c24..4a6a6a4 100644 --- a/modules/widget_dao/dao/feature_dao.cpp +++ b/modules/widget_dao/dao/feature_dao.cpp @@ -52,7 +52,7 @@ FeatureHandle RegisterFeature(const PluginMetafileData::Feature &feature, //register feature { - LogInfo(" |-- Registering feature " << feature.m_name); + LogDebug(" |-- Registering feature " << feature.m_name); FeaturesList::Row row; row.Set_FeatureName(DPL::FromUTF8String(feature.m_name)); @@ -73,7 +73,7 @@ FeatureHandle RegisterFeature(const PluginMetafileData::Feature &feature, int deviceCapID; if (FeatureDAOReadOnly::isDeviceCapabilityInstalled(*itdev)) { - LogInfo(" | |--DeviceCap " << *itdev << + LogDebug(" | |--DeviceCap " << *itdev << " already installed!"); WRT_DB_SELECT(select, @@ -86,7 +86,7 @@ FeatureHandle RegisterFeature(const PluginMetafileData::Feature &feature, deviceCapID = select->GetSingleValue(); } else { - LogInfo(" | |--Register DeviceCap: " << *itdev); + LogDebug(" | |--Register DeviceCap: " << *itdev); DeviceCapabilities::Row row; row.Set_DeviceCapName(DPL::FromUTF8String(*itdev)); diff --git a/modules/widget_dao/dao/global_dao.cpp b/modules/widget_dao/dao/global_dao.cpp index 8678c3d..dc543c4 100644 --- a/modules/widget_dao/dao/global_dao.cpp +++ b/modules/widget_dao/dao/global_dao.cpp @@ -47,63 +47,6 @@ void GlobalDAO::SetSecureByDefault(bool secure) } } -void GlobalDAO::setComplianceMode(bool mode) -{ - LogDebug("Updating compliance mode to:" << mode); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - GlobalProperties::Row row; - row.Set_compliance_mode(mode); - - WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface()) - update->Values(row); - update->Execute(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAO::Exception::DatabaseError, - "Failed to update compliance mode"); - } -} - -void GlobalDAO::setComplianceFakeImei(const std::string &imei) -{ - LogDebug("Setting compliance fake IMEI: " << imei); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - GlobalProperties::Row row; - row.Set_compliance_fake_imei(DPL::FromASCIIString(imei)); - - WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface()) - update->Values(row); - update->Execute(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAO::Exception::DatabaseError, - "Failed to update compliance fake IMEI"); - } -} - -void GlobalDAO::setComplianceFakeMeid(const std::string &meid) -{ - LogDebug("Setting compliance fake MEID: " << meid); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - GlobalProperties::Row row; - row.Set_compliance_fake_meid(DPL::FromASCIIString(meid)); - - WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface()) - update->Values(row); - update->Execute(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAO::Exception::DatabaseError, - "Failed to update compliance fake MEID"); - } -} - void GlobalDAO::SetHomeNetworkDataUsage(GlobalDAO::NetworkAccessMode newMode) { LogDebug("updating home network data usage to:" << newMode); diff --git a/modules/widget_dao/dao/global_dao_read_only.cpp b/modules/widget_dao/dao/global_dao_read_only.cpp index 3916e57..071ca43 100644 --- a/modules/widget_dao/dao/global_dao_read_only.cpp +++ b/modules/widget_dao/dao/global_dao_read_only.cpp @@ -41,75 +41,6 @@ bool GlobalDAOReadOnly::GetSecureByDefault() return select->GetSingleValue(); } -bool GlobalDAOReadOnly::getComplianceMode() -{ - LogDebug("Getting compliance mode"); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface()) - return select->GetSingleValue(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError, - "Failed to get compliance mode"); - } -} - -std::string GlobalDAOReadOnly::getComplianceFakeImei() -{ - LogDebug("Getting compliance fake IMEI"); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface()) - DPL::Optional result = - select->GetSingleValue(); - if (!result) { - return std::string(); - } - return DPL::ToUTF8String(*result); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError, - "Failed to get compliance fake IMEI"); - } -} - -std::string GlobalDAOReadOnly::getComplianceFakeMeid() -{ - LogDebug("Getting compliance fake MEID"); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface()) - DPL::Optional result = - select->GetSingleValue(); - if (!result) { - return std::string(); - } - return DPL::ToUTF8String(*result); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError, - "Failed to get compliance fake MEID"); - } -} - -bool GlobalDAOReadOnly::IsValidSubTag(const DPL::String& tag, int type) -{ - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, iana_records, &WrtDatabase::interface()) - select->Where(Equals(tag)); - auto row = select->GetRowList(); - if (row.empty() || row.front().Get_TYPE() != type) { - return false; - } else { - return true; - } -} - GlobalDAOReadOnly::NetworkAccessMode GlobalDAOReadOnly::GetHomeNetworkDataUsage() { @@ -228,7 +159,7 @@ WidgetAccessInfoList GlobalDAOReadOnly::GetWhiteURIList() whiteURI.strIRI = i->Get_uri(); whiteURI.bSubDomains = i->Get_subdomain_access(); resultList.push_back(whiteURI); - LogInfo("[uri] : " << whiteURI.strIRI << + LogDebug("[uri] : " << whiteURI.strIRI << ", [subdomain] : " << whiteURI.bSubDomains); } return resultList; diff --git a/modules/widget_dao/dao/plugin_dao.cpp b/modules/widget_dao/dao/plugin_dao.cpp index cc8dcbf..5b899c3 100644 --- a/modules/widget_dao/dao/plugin_dao.cpp +++ b/modules/widget_dao/dao/plugin_dao.cpp @@ -49,7 +49,7 @@ DbPluginHandle PluginDAO::registerPlugin(const PluginMetafileData& metafile, if (isPluginInstalled(metafile.m_libraryName)) { handle = PluginDAO(metafile.m_libraryName).getPluginHandle(); - LogInfo(" >> Library " << metafile.m_libraryName << + LogDebug(" >> Library " << metafile.m_libraryName << " is already registered. Handle: " << handle); } else { LogDebug("Register Plugin: " << metafile.m_libraryName); @@ -219,7 +219,7 @@ void PluginDAO::unregisterPlugin(DbPluginHandle pluginHandle) &WrtDatabase::interface()); if (!isPluginInstalled(pluginHandle)) { - LogInfo("PluginHandle is invalid. Handle: " << pluginHandle); + LogDebug("PluginHandle is invalid. Handle: " << pluginHandle); return; } else { using namespace DPL::DB::ORM; diff --git a/modules/widget_dao/dao/widget_dao.cpp b/modules/widget_dao/dao/widget_dao.cpp index 2e79ea0..1061fe0 100644 --- a/modules/widget_dao/dao/widget_dao.cpp +++ b/modules/widget_dao/dao/widget_dao.cpp @@ -198,14 +198,14 @@ void WidgetDAO::setWebDatabaseUsage(const SettingsType value) void WidgetDAO::registerWidget( const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity) + const IWidgetSecurity &widgetSecurity) { LogDebug("Registering widget"); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { DPL::DB::ORM::wrt::ScopedTransaction transaction( &WrtDatabase::interface()); - registerWidgetInternal(tzAppId, widgetRegInfo, wacSecurity); + registerWidgetInternal(tzAppId, widgetRegInfo, widgetSecurity); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget") @@ -213,7 +213,7 @@ void WidgetDAO::registerWidget( DbWidgetHandle WidgetDAO::registerWidget( const WidgetRegisterInfo &pWidgetRegisterInfo, - const IWacSecurity &wacSecurity) + const IWidgetSecurity &widgetSecurity) { //make it more precise due to very fast tests struct timeval tv; @@ -226,30 +226,30 @@ DbWidgetHandle WidgetDAO::registerWidget( registerWidget(*pWidgetRegisterInfo.configInfo.tizenAppId, pWidgetRegisterInfo, - wacSecurity); + widgetSecurity); return widgetHandle; } TizenAppId WidgetDAO::registerWidgetGeneratePkgId( const WidgetRegisterInfo &pWidgetRegisterInfo, - const IWacSecurity &wacSecurity) + const IWidgetSecurity &widgetSecurity) { TizenAppId tzAppId = generatePkgId(); - registerWidget(tzAppId, pWidgetRegisterInfo, wacSecurity); + registerWidget(tzAppId, pWidgetRegisterInfo, widgetSecurity); return tzAppId; } void WidgetDAO::registerWidgetInternal( const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity, + const IWidgetSecurity &widgetSecurity, const DPL::Optional handle) { //Register into WidgetInfo has to be first //as all other tables depend upon that DbWidgetHandle widgetHandle = registerWidgetInfo(tzAppId, widgetRegInfo, - wacSecurity, + widgetSecurity, handle); registerWidgetExtendedInfo(widgetHandle, widgetRegInfo); @@ -272,14 +272,14 @@ void WidgetDAO::registerWidgetInternal( registerWidgetAllowNavigationInfo(widgetHandle, widgetRegInfo); - registerWidgetCertificates(widgetHandle, wacSecurity); + registerWidgetCertificates(widgetHandle, widgetSecurity); CertificateChainList list; - wacSecurity.getCertificateChainList(list, SIGNATURE_DISTRIBUTOR); + widgetSecurity.getCertificateChainList(list, SIGNATURE_DISTRIBUTOR); registerCertificatesChains(widgetHandle, SIGNATURE_DISTRIBUTOR, list); list.clear(); - wacSecurity.getCertificateChainList(list, SIGNATURE_AUTHOR); + widgetSecurity.getCertificateChainList(list, SIGNATURE_AUTHOR); registerCertificatesChains(widgetHandle, SIGNATURE_AUTHOR, list); registerWidgetSettings(widgetHandle, widgetRegInfo); @@ -296,7 +296,7 @@ void WidgetDAO::registerWidgetInternal( void WidgetDAO::registerOrUpdateWidget( const TizenAppId & widgetName, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity) + const IWidgetSecurity &widgetSecurity) { LogDebug("Reregistering widget"); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN @@ -305,7 +305,7 @@ void WidgetDAO::registerOrUpdateWidget( &WrtDatabase::interface()); unregisterWidgetInternal(widgetName); - registerWidgetInternal(widgetName, widgetRegInfo, wacSecurity); + registerWidgetInternal(widgetName, widgetRegInfo, widgetSecurity); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to reregister widget") @@ -315,7 +315,7 @@ void WidgetDAO::backupAndUpdateWidget( const TizenAppId & oldAppId, const TizenAppId & newAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity) + const IWidgetSecurity &widgetSecurity) { LogDebug("Backup and Register widget"); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN @@ -324,7 +324,7 @@ void WidgetDAO::backupAndUpdateWidget( &WrtDatabase::interface()); updateWidgetAppIdInternal(newAppId, oldAppId); - registerWidgetInternal(newAppId, widgetRegInfo, wacSecurity); + registerWidgetInternal(newAppId, widgetRegInfo, widgetSecurity); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to reregister widget") @@ -365,7 +365,6 @@ void WidgetDAO::registerWidgetExtendedInfo(DbWidgetHandle widgetHandle, row.Set_app_id(widgetHandle); // row.Set_share_href (DPL::FromUTF8String(regInfo.shareHref)); row.Set_signature_type(regInfo.signatureType); - row.Set_test_widget(regInfo.isTestWidget); row.Set_install_time(regInfo.installedTime); row.Set_splash_img_src(regInfo.configInfo.splashImgSrc); row.Set_background_page(regInfo.configInfo.backgroundPage); @@ -377,7 +376,7 @@ void WidgetDAO::registerWidgetExtendedInfo(DbWidgetHandle widgetHandle, DbWidgetHandle WidgetDAO::registerWidgetInfo( const TizenAppId & tzAppId, const WidgetRegisterInfo ®Info, - const IWacSecurity &wacSecurity, + const IWidgetSecurity &widgetSecurity, const DPL::Optional handle) { using namespace DPL::DB::ORM; @@ -406,9 +405,8 @@ DbWidgetHandle WidgetDAO::registerWidgetInfo( row.Set_csp_policy_report_only(widgetConfigurationInfo.cspPolicyReportOnly); row.Set_base_folder(DPL::FromUTF8String(regInfo.baseFolder)); row.Set_webkit_plugins_required(widgetConfigurationInfo.flashNeeded); - row.Set_recognized(wacSecurity.isRecognized()); - row.Set_wac_signed(wacSecurity.isWacSigned()); - row.Set_distributor_signed(wacSecurity.isDistributorSigned()); + row.Set_recognized(widgetSecurity.isRecognized()); + row.Set_distributor_signed(widgetSecurity.isDistributorSigned()); row.Set_tizen_appid(tzAppId); row.Set_tizen_pkgid(regInfo.tzPkgid); { @@ -648,12 +646,12 @@ void WidgetDAO::registerWidgetAllowNavigationInfo(DbWidgetHandle widgetHandle, } void WidgetDAO::registerWidgetCertificates(DbWidgetHandle widgetHandle, - const IWacSecurity &wacSecurity) + const IWidgetSecurity &widgetSecurity) { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; - FOREACH(it, wacSecurity.getCertificateList()) + FOREACH(it, widgetSecurity.getCertificateList()) { WidgetCertificateFingerprint::Row row; row.Set_app_id(widgetHandle); diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index 3890603..5b3ffa1 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -178,7 +178,7 @@ TizenPkgId getTizenPkgIdByHandle(const DbWidgetHandle handle) } } // namespace -IWacSecurity::~IWacSecurity() +IWidgetSecurity::~IWidgetSecurity() {} WidgetDAOReadOnly::WidgetDAOReadOnly(DbWidgetHandle widgetHandle) : @@ -629,16 +629,6 @@ bool WidgetDAOReadOnly::isRecognized() const return static_cast(*result); } -bool WidgetDAOReadOnly::isWacSigned() const -{ - WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); - DPL::OptionalInt result = row.Get_wac_signed(); - if (result.IsNull()) { - return false; - } - return static_cast(*result); -} - bool WidgetDAOReadOnly::isDistributorSigned() const { WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); @@ -656,26 +646,6 @@ bool WidgetDAOReadOnly::isTrusted() const return isDistributorSigned(); } -bool WidgetDAOReadOnly::isTestWidget() const -{ - Try { - WRT_DB_SELECT(select, WidgetExtendedInfo, &WrtDatabase::interface()) - select->Where(Equals(m_widgetHandle)); - - WidgetExtendedInfo::Select::RowList rows = select->GetRowList(); - if (rows.empty()) { - ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, - "Cannot find widget. Handle: " << m_widgetHandle); - } - - return static_cast(rows.front().Get_test_widget()); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(WidgetDAOReadOnly::Exception::DatabaseError, - "Failed to check IsTestWidget"); - } -} - DPL::OptionalString WidgetDAOReadOnly::getCspPolicy() const { WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); @@ -1270,4 +1240,4 @@ WidgetSecurityModelVersion WidgetDAOReadOnly::getSecurityModelVersion() const #undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN #undef SQL_CONNECTION_EXCEPTION_HANDLER_END #undef CHECK_WIDGET_EXISTENCE -} // namespace WrtDB \ No newline at end of file +} // namespace WrtDB diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h index a91b73f..9537ce1 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h @@ -236,7 +236,6 @@ typedef std::list DbWidgetDAOReadOnlyList; enum AppType { APP_TYPE_UNKNOWN = 0, // unknown - APP_TYPE_WAC20, // WAC 2.0 APP_TYPE_TIZENWEBAPP // Tizen webapp }; @@ -262,7 +261,6 @@ class WidgetType switch (appType) { #define X(x) case x: return #x; X(APP_TYPE_UNKNOWN) - X(APP_TYPE_WAC20) X(APP_TYPE_TIZENWEBAPP) #undef X default: diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h index eceaaec..399cbde 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h @@ -331,6 +331,7 @@ class ConfigParserData DPL::OptionalString tizenAppId; // allow-navigation + bool allowNavigationEncountered; AllowNavigationInfoList allowNavigationInfoList; //csp polic for widget @@ -361,6 +362,7 @@ class ConfigParserData backSupported(false), accessNetwork(false), startFileEncountered(false), + allowNavigationEncountered(false), securityModelVersion(SecurityModelVersion::SECURITY_MODEL_V1) {} }; diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h b/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h index cf5647b..6d193e4 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h @@ -170,11 +170,6 @@ inline const char* GetSignatureXmlSchema() return "/usr/share/wrt-engine/schema.xsd"; } -inline const char* GetWAC20TestRootCAFilePath() -{ - return "/usr/share/wrt-engine/WAC2.0TestRootCA.cert"; -} - /** * Name of the w3c geolocation feature */ @@ -265,11 +260,6 @@ inline const char* GetTmpDirPath() return "/tmp"; } -inline const char* GetWACVersion() -{ - return "2.0"; -} - inline const char* GetTizenVersion() { return "2.2"; diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h index bc805a7..0206e89 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h @@ -55,16 +55,8 @@ class GlobalDAOReadOnly public: - static bool IsValidSubTag(const DPL::String& tag, int type); - static bool GetSecureByDefault(); - static bool getComplianceMode(); - - static std::string getComplianceFakeImei(); - - static std::string getComplianceFakeMeid(); - static WidgetAccessInfoList GetWhiteURIList(); static bool GetCookieSharingMode(); diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h index f265281..7cf793a 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h @@ -157,7 +157,6 @@ struct WidgetRegisterInfo WidgetRegisterInfo() : webAppType(APP_TYPE_UNKNOWN), signatureType(SIGNATURE_TYPE_UNIDENTIFIED), - isTestWidget(0), configInfo(), packagingType(PKG_TYPE_UNKNOWN) {} @@ -169,7 +168,6 @@ struct WidgetRegisterInfo std::string shareHref; std::string baseFolder; WidgetSignatureType signatureType; - int isTestWidget; ConfigParserData configInfo; LocalizationData localizationData; @@ -184,10 +182,10 @@ struct WidgetRegisterInfo }; typedef std::list CertificateChainList; -class IWacSecurity +class IWidgetSecurity { public: - virtual ~IWacSecurity(); + virtual ~IWidgetSecurity(); virtual const WidgetCertificateDataList& getCertificateList() const = 0; @@ -195,8 +193,6 @@ class IWacSecurity virtual bool isDistributorSigned() const = 0; - virtual bool isWacSigned() const = 0; - virtual void getCertificateChainList(CertificateChainList& list, CertificateSource source) const = 0; }; @@ -456,12 +452,6 @@ class WidgetDAOReadOnly * WAC 2.0 extension * @return */ - bool isWacSigned() const; - - /** - * WAC 2.0 extension - * @return - */ bool isDistributorSigned() const; /** @@ -471,12 +461,6 @@ class WidgetDAOReadOnly bool isTrusted() const; /** - * WAC 2.0 extension - * @return is WAC test widget - */ - bool isTestWidget() const; - - /** * This method returns window mode of widget. * * @return window modes of widget diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h index 5522306..9b72a89 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h @@ -31,12 +31,6 @@ class GlobalDAO : public GlobalDAOReadOnly public: static void SetSecureByDefault(bool secureByDefault); - static void setComplianceMode(bool mode); - - static void setComplianceFakeImei(const std::string &imei); - - static void setComplianceFakeMeid(const std::string &meid); - static void AddWhiteURI(const std::string &value, bool subDomain); static void RemoveWhiteURI(const std::string &uri); diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h index 9830f68..42fb635 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h @@ -61,16 +61,16 @@ class WidgetDAO : public WidgetDAOReadOnly * @param[in] TizenAppId Widget app id that will be registered. * @param[in] pWidgetRegisterInfo Specified the widget's information * needed to be registered. - * @param[in] wacSecurity Widget's security certificates. + * @param[in] widgetSecurity Widget's security certificates. */ static void registerWidget( const TizenAppId& tzAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity); + const IWidgetSecurity &widgetSecurity); static DbWidgetHandle registerWidget( const WidgetRegisterInfo &pWidgetRegisterInfo, - const IWacSecurity &wacSecurity) __attribute__((deprecated)); + const IWidgetSecurity &widgetSecurity) __attribute__((deprecated)); /** * @brief registerWidgetGenerateTizenId Registers widget with auto-generated @@ -80,12 +80,12 @@ class WidgetDAO : public WidgetDAOReadOnly * Function is not thread-safe. * * @param pWidgetRegisterInfo registeration information - * @param wacSecurity Widget's security certificates. + * @param widgetSecurity Widget's security certificates. * @return tzAppId generated */ static TizenAppId registerWidgetGeneratePkgId( const WidgetRegisterInfo &pWidgetRegisterInfo, - const IWacSecurity &wacSecurity); + const IWidgetSecurity &widgetSecurity); /** * This method re-registers the widget information to the DB when it is @@ -98,12 +98,12 @@ class WidgetDAO : public WidgetDAOReadOnly * @param[in] tzAppId Widget tizen app id that will be registered. * @param[in] pWidgetRegisterInfo Specified the widget's information * needed to be registered. - * @param[in] wacSecurity Widget's security certificates. + * @param[in] widgetSecurity Widget's security certificates. */ static void registerOrUpdateWidget( const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity); + const IWidgetSecurity &widgetSecurity); /* This method backup widget information and update new widget information * for restore widget information @@ -112,7 +112,7 @@ class WidgetDAO : public WidgetDAOReadOnly const TizenAppId & oldAppId, const TizenAppId & newAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity); + const IWidgetSecurity &widgetSecurity); static void restoreUpdateWidget( const TizenAppId & oldAppId, @@ -168,7 +168,7 @@ class WidgetDAO : public WidgetDAOReadOnly static DbWidgetHandle registerWidgetInfo( const TizenAppId & widgetName, const WidgetRegisterInfo ®Info, - const IWacSecurity &wacSecurity, + const IWidgetSecurity &widgetSecurity, const DPL::Optional handle = DPL::Optional()); static void registerWidgetExtendedInfo( @@ -203,7 +203,7 @@ class WidgetDAO : public WidgetDAOReadOnly const WidgetRegisterInfo ®Info); static void registerWidgetCertificates( DbWidgetHandle widgetHandle, - const IWacSecurity &wacSecurity); + const IWidgetSecurity &widgetSecurity); static void registerCertificatesChains( DbWidgetHandle widgetHandle, CertificateSource certificateSource, @@ -231,7 +231,7 @@ class WidgetDAO : public WidgetDAOReadOnly static void registerWidgetInternal( const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, - const IWacSecurity &wacSecurity, + const IWidgetSecurity &widgetSecurity, const DPL::Optional handle = DPL::Optional()); static void unregisterWidgetInternal( diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index d4c747b..b7bcf76 100644 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -7,9 +7,6 @@ CREATE_TABLE(GlobalProperties) COLUMN_NOT_NULL(secure_by_default, INT, DEFAULT 1) COLUMN_NOT_NULL(home_network_data_usage, TINYINT, DEFAULT 1) COLUMN_NOT_NULL(roaming_data_usage, TINYINT, DEFAULT 1) - COLUMN_NOT_NULL(compliance_mode, TINYINT, DEFAULT 0) - COLUMN_NOT_NULL(compliance_fake_imei, VARCHAR(256), DEFAULT '') - COLUMN_NOT_NULL(compliance_fake_meid, VARCHAR(256), DEFAULT '') COLUMN_NOT_NULL(cookie_sharing_mode, INT, DEFAULT 0) CREATE_TABLE_END() diff --git a/modules/widget_dao/orm/wrt_db_definitions b/modules/widget_dao/orm/wrt_db_definitions index 1e2200e..f2a4a2e 100644 --- a/modules/widget_dao/orm/wrt_db_definitions +++ b/modules/widget_dao/orm/wrt_db_definitions @@ -1,7 +1,6 @@ DATABASE_START(wrt) #include "wrt_db" -#include "iana_db" #include "version_db" DATABASE_END() diff --git a/packaging/wrt-commons.spec b/packaging/wrt-commons.spec index 206ea76..406d974 100644 --- a/packaging/wrt-commons.spec +++ b/packaging/wrt-commons.spec @@ -1,7 +1,7 @@ #git:framework/web/wrt-commons Name: wrt-commons Summary: Wrt common library -Version: 0.2.135 +Version: 0.2.139 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 @@ -132,6 +132,8 @@ chsmack -a 'wrt-commons::db_wrt' /opt/dbspace/.wrt.db chsmack -a 'wrt-commons::db_wrt' /opt/dbspace/.wrt.db-journal chsmack -a 'wrt-commons::db_wrt' /opt/usr/dbspace/.wrt_custom_handler.db chsmack -a 'wrt-commons::db_wrt' /opt/usr/dbspace/.wrt_custom_handler.db-journal +chsmack -a 'wrt-commons::db_wrt_i18n' /opt/usr/dbspace/.wrt_i18n.db +chsmack -a 'wrt-commons::db_wrt_i18n' /opt/usr/dbspace/.wrt_i18n.db-journal echo "[WRT] wrt-commons postinst done ..." diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b271d5c..50227c7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,6 +19,7 @@ ADD_SUBDIRECTORY(event) ADD_SUBDIRECTORY(files_localization) ADD_SUBDIRECTORY(localizationTagsProvider) ADD_SUBDIRECTORY(utils) +ADD_SUBDIRECTORY(i18n) IF(WITH_CHILD) MESSAGE(STATUS "Additional test subdirectory is being added") diff --git a/tests/common/src/loop_control.cpp b/tests/common/src/loop_control.cpp index 4855288..5c690c2 100644 --- a/tests/common/src/loop_control.cpp +++ b/tests/common/src/loop_control.cpp @@ -34,7 +34,7 @@ void init_loop(int argc, char *argv[]) g_type_init(); g_thread_init(NULL); - LogInfo("Starting"); + LogDebug("Starting"); elm_init(argc, argv); } diff --git a/tests/core/CMakeLists.txt b/tests/core/CMakeLists.txt index 4348519..18665eb 100644 --- a/tests/core/CMakeLists.txt +++ b/tests/core/CMakeLists.txt @@ -51,6 +51,7 @@ SET(DPL_TESTS_CORE_SOURCES ${TESTS_DIR}/core/test_thread.cpp ${TESTS_DIR}/core/test_type_list.cpp ${TESTS_DIR}/core/test_zip_input.cpp + ${TESTS_DIR}/core/test_scope_guard.cpp ) WRT_TEST_ADD_INTERNAL_DEPENDENCIES(${TARGET_NAME} ${TARGET_DPL_EFL}) diff --git a/tests/core/test_scope_guard.cpp b/tests/core/test_scope_guard.cpp new file mode 100644 index 0000000..7c09645 --- /dev/null +++ b/tests/core/test_scope_guard.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * @file test_scope_guard.cpp + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief This file is the implementation file of test scope guard + */ +#include +#include + +namespace { +bool g_guardCalled = false; + +void regularFunction() +{ + g_guardCalled = true; +} + +struct Functor +{ + explicit Functor(bool& guardCalled) + : m_guardCalled(guardCalled) + {} + + void operator()() + { + m_guardCalled = true; + } + + bool& m_guardCalled; +}; +} + +RUNNER_TEST_GROUP_INIT(DPL) + +/* +Name: ScopeGuard_MakeScopeGuard_RegularFunction +Description: tests scope guard, created explicitly, with regular function +Expected: guard should be called +*/ +RUNNER_TEST(ScopeGuard_MakeScopeGuard_RegularFunction) +{ + g_guardCalled = false; + { + auto guard = DPL::MakeScopeGuard(regularFunction); + } + RUNNER_ASSERT(g_guardCalled); +} + +/* +Name: ScopeGuard_MakeScopeGuard_Functor +Description: tests scope guard, created explicitly, with a functor +Expected: guard should be called +*/ +RUNNER_TEST(ScopeGuard_MakeScopeGuard_Functor) +{ + g_guardCalled = false; + { + auto guard = DPL::MakeScopeGuard(Functor(g_guardCalled)); + } + RUNNER_ASSERT(g_guardCalled); +} + +/* +Name: ScopeGuard_MakeScopeGuard_Lambda +Description: tests scope guard, created explicitly, with a lambda +Expected: guard should be called +*/ +RUNNER_TEST(ScopeGuard_MakeScopeGuard_Lambda) +{ + g_guardCalled = false; + { + auto guard = DPL::MakeScopeGuard( + [&g_guardCalled](){ g_guardCalled = true; }); + } + RUNNER_ASSERT(g_guardCalled); +} + +/* +Name: ScopeGuard_Macro +Description: tests scope guard, created implicitly, with a lambda +Expected: guard should be called +*/ +RUNNER_TEST(ScopeGuard_Macro) +{ + g_guardCalled = false; + { + DPL_SCOPE_EXIT(&g_guardCalled) + { + g_guardCalled = true; + }; + } + RUNNER_ASSERT(g_guardCalled); +} + +/* +Name: ScopeGuard_Release +Description: tests scope guard releasing API +Expected: guard should not be called +*/ +RUNNER_TEST(ScopeGuard_Release) +{ + g_guardCalled = false; + { + auto guard = DPL::MakeScopeGuard( + [&g_guardCalled](){ g_guardCalled = true; }); + guard.Release(); + } + RUNNER_ASSERT(!g_guardCalled); +} diff --git a/tests/core/test_thread.cpp b/tests/core/test_thread.cpp index 5db0dc1..8eec1f0 100644 --- a/tests/core/test_thread.cpp +++ b/tests/core/test_thread.cpp @@ -33,18 +33,18 @@ class Foo int id; Foo(int i = 0) : id(i) { - LogInfo("Foo: ctor: " << id); + LogDebug("Foo: ctor: " << id); } ~Foo() { - LogInfo("Foo: dtor: " << id); + LogDebug("Foo: dtor: " << id); g_wasFooDeleted = true; } void Bar() { - LogInfo("Foo: bar"); + LogDebug("Foo: bar"); } }; @@ -57,7 +57,7 @@ class FooThread : protected: virtual int ThreadEntry() { - LogInfo("In thread"); + LogDebug("In thread"); RUNNER_ASSERT(!g_foo); RUNNER_ASSERT(g_foo.IsNull()); diff --git a/tests/dao/TestCases_WidgetDAO.cpp b/tests/dao/TestCases_WidgetDAO.cpp index 204bc3e..7e1f603 100644 --- a/tests/dao/TestCases_WidgetDAO.cpp +++ b/tests/dao/TestCases_WidgetDAO.cpp @@ -36,13 +36,12 @@ using namespace WrtDB; namespace { -class WacSecurityMock : public WrtDB::IWacSecurity +class WacSecurityMock : public WrtDB::IWidgetSecurity { public: WacSecurityMock() : mRecognized(false), - mDistributorSigned(false), - mWacSigned(false) + mDistributorSigned(false) {} virtual const WidgetCertificateDataList& getCertificateList() const @@ -58,10 +57,6 @@ class WacSecurityMock : public WrtDB::IWacSecurity { return mDistributorSigned; } - virtual bool isWacSigned() const - { - return mWacSigned; - } virtual void getCertificateChainList(CertificateChainList& /*lst*/) const {} virtual void getCertificateChainList(CertificateChainList& /*lst*/, CertificateSource /*source*/) const {} @@ -79,10 +74,6 @@ class WacSecurityMock : public WrtDB::IWacSecurity { mDistributorSigned = distributorSigned; } - void setWacSigned(bool wacSigned) - { - mWacSigned = wacSigned; - } private: WrtDB::WidgetCertificateDataList mList; @@ -91,11 +82,10 @@ class WacSecurityMock : public WrtDB::IWacSecurity // known distribuor bool mDistributorSigned; // distributor is wac - bool mWacSigned; }; TizenAppId _registerWidget(const WidgetRegisterInfo& regInfo, - const IWacSecurity& sec, + const IWidgetSecurity& sec, int line) { TizenAppId tizenAppId; @@ -1086,11 +1076,9 @@ RUNNER_TEST(widget_dao_test_wac_security) RUNNER_ASSERT(!dao.isDistributorSigned()); RUNNER_ASSERT(!dao.isRecognized()); - RUNNER_ASSERT(!dao.isWacSigned()); } sec.setDistributorSigned(true); sec.setRecognized(true); - sec.setWacSigned(true); { // register widget TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec); @@ -1098,7 +1086,6 @@ RUNNER_TEST(widget_dao_test_wac_security) RUNNER_ASSERT(dao.isDistributorSigned()); RUNNER_ASSERT(dao.isRecognized()); - RUNNER_ASSERT(dao.isWacSigned()); } } @@ -1142,4 +1129,4 @@ RUNNER_TEST(widget_dao_test_register_csp_empty) RUNNER_ASSERT_MSG(dao.getCspPolicy().IsNull(), "Policy is not null"); } } -#undef RUNNER_ASSERT_WHAT_EQUALS \ No newline at end of file +#undef RUNNER_ASSERT_WHAT_EQUALS diff --git a/tests/dao/tests_dao.cpp b/tests/dao/tests_dao.cpp index 73456db..ae3c7cd 100644 --- a/tests/dao/tests_dao.cpp +++ b/tests/dao/tests_dao.cpp @@ -37,7 +37,7 @@ int main (int argc, char *argv[]) WrtDB::WrtDatabase::attachToThreadRW(); CustomHandlerDB::Interface::attachDatabaseRW(); - LogInfo("Starting tests"); + LogDebug("Starting tests"); int status = DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv); diff --git a/tests/dbus/main.cpp b/tests/dbus/main.cpp index d06a4c0..4dfd0b4 100644 --- a/tests/dbus/main.cpp +++ b/tests/dbus/main.cpp @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) { LoopControl::init_loop(argc, argv); - LogInfo("Running tests"); + LogDebug("Running tests"); int status = DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv); diff --git a/tests/event/test_event_support.cpp b/tests/event/test_event_support.cpp index e900e9c..cf7e1c8 100644 --- a/tests/event/test_event_support.cpp +++ b/tests/event/test_event_support.cpp @@ -112,7 +112,7 @@ void OnDelegateTest(const int &k); void OnDelegateTest(const int &k) { - LogInfo("Got delegate call"); + LogDebug("Got delegate call"); g_delegateTest = k; } diff --git a/tests/event/test_ic_delegate.cpp b/tests/event/test_ic_delegate.cpp index 77856f4..cc28b4f 100644 --- a/tests/event/test_ic_delegate.cpp +++ b/tests/event/test_ic_delegate.cpp @@ -511,7 +511,7 @@ class ICReuseTestController : { event.GetArg0() (); //calling intercontext delegate if (++m_reuseCount < ReuseCount) { - LogInfo("[Send] Reuse: " << m_reuseCount); + LogDebug("[Send] Reuse: " << m_reuseCount); DPL::Event::ControllerEventHandler::PostEvent( event); } diff --git a/tests/i18n/CMakeLists.txt b/tests/i18n/CMakeLists.txt new file mode 100644 index 0000000..9a90b43 --- /dev/null +++ b/tests/i18n/CMakeLists.txt @@ -0,0 +1,40 @@ +# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @file CMakeLists.txt +# @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) +# @version 1.0 +# @brief +# + +# +# Test files +# +# Define all DPL tests sources. +# Runner is responsible for runnint it all and +# generating proper output files +# + +SET(TARGET_NAME "wrt-commons-tests-i18n") + +# Set DPL tests sources +SET(DPL_TESTS_I18N_SOURCES + ${TESTS_DIR}/i18n/main.cpp + ${TESTS_DIR}/i18n/test_i18n_dao_read_only.cpp +) + +#include subdirectory +WRT_TEST_ADD_INTERNAL_DEPENDENCIES(${TARGET_NAME} ${TARGET_I18N_DAO_RO_LIB}) +WRT_TEST_BUILD(${TARGET_NAME} ${DPL_TESTS_I18N_SOURCES}) +WRT_TEST_INSTALL(${TARGET_NAME}) diff --git a/tests/i18n/main.cpp b/tests/i18n/main.cpp new file mode 100644 index 0000000..4ed6191 --- /dev/null +++ b/tests/i18n/main.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file main.cpp + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief This file is the implementation file of main. + */ + +#include + +int main(int argc, char *argv[]) +{ + return DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv); +} diff --git a/tests/i18n/test_i18n_dao_read_only.cpp b/tests/i18n/test_i18n_dao_read_only.cpp new file mode 100644 index 0000000..57dfe2d --- /dev/null +++ b/tests/i18n/test_i18n_dao_read_only.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * @file test_i18n_dao_read_only.cpp + * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com) + * @version 1.0 + * @brief This file is the implementation file of i18n dao tests + */ +#include +#include +#include +#include + +RUNNER_TEST_GROUP_INIT(I18N) + +/* +Name: I18nDAOReadOnly_IsValidSubTag_True +Description: Test valid IANA subtag presence +Expected: Subtag found +*/ +RUNNER_TEST(I18nDAOReadOnly_IsValidSubTag_True) +{ + I18n::DB::Interface::attachDatabaseRO(); + bool result = I18n::DB::I18nDAOReadOnly::IsValidSubTag(L"aa", 0); + I18n::DB::Interface::detachDatabase(); + RUNNER_ASSERT_MSG(result, "Subtag not found"); +} + +/* +Name: I18nDAOReadOnly_IsValidSubTag_False +Description: Test invalid IANA subtag presence +Expected: Subtag not found +*/ +RUNNER_TEST(I18nDAOReadOnly_IsValidSubTag_False) +{ + I18n::DB::Interface::attachDatabaseRO(); + bool result = I18n::DB::I18nDAOReadOnly::IsValidSubTag(L"xxx000xxx", -1); + I18n::DB::Interface::detachDatabase(); + RUNNER_ASSERT_MSG(!result, "Subtag found"); +} diff --git a/tests/localizationTagsProvider/Localization_testcases.cpp b/tests/localizationTagsProvider/Localization_testcases.cpp index bd4b003..295ca7c 100644 --- a/tests/localizationTagsProvider/Localization_testcases.cpp +++ b/tests/localizationTagsProvider/Localization_testcases.cpp @@ -30,7 +30,7 @@ RUNNER_TEST_GROUP_INIT(LanguageTagsProvider) RUNNER_TEST(tagsFromSystemLocales) { - LogInfo("Generating tags from system locales"); + LogDebug("Generating tags from system locales"); char* currlocals = vconf_get_str(VCONFKEY_LANGSET); LogDebug("Locales fetched from system settings: " << currlocals); @@ -62,7 +62,7 @@ RUNNER_TEST(tagsFromSystemLocales) RUNNER_TEST(tagsFromGivenLocales) { - LogInfo("Generating tags from given locales"); + LogDebug("Generating tags from given locales"); const char *locales1 = "it_IT.UTF-8", *locales2="en_GB"; @@ -89,7 +89,7 @@ RUNNER_TEST(tagsFromGivenLocales) RUNNER_TEST(tagsFromNullLocales) { - LogInfo("Generating tags when NULL locales given"); + LogDebug("Generating tags when NULL locales given"); LanguageTagsProviderSingleton::Instance().setLanguageTagsFromLocales(NULL); LanguageTags ltlist = LanguageTagsProviderSingleton::Instance().getLanguageTags(); @@ -102,7 +102,7 @@ RUNNER_TEST(tagsFromNullLocales) RUNNER_TEST(tagsFromGivenTagList) { - LogInfo("Copying given tags list"); + LogDebug("Copying given tags list"); LogDebug("Correct full list (with default values)"); LanguageTags correct; @@ -129,7 +129,7 @@ RUNNER_TEST(tagsFromGivenTagList) RUNNER_TEST(tagsFromEmptyList) { - LogInfo("Generating tags when empty tag list given"); + LogDebug("Generating tags when empty tag list given"); LanguageTags input; LanguageTagsProviderSingleton::Instance().setLanguageTags(input); @@ -139,7 +139,7 @@ RUNNER_TEST(tagsFromEmptyList) RUNNER_TEST(defaultWidgetLocale) { - LogInfo("Adding default widget locales to language tags list"); + LogDebug("Adding default widget locales to language tags list"); LanguageTags input; input.push_back(L"de-DE"); diff --git a/tests/localizationTagsProvider/tests_miscunit.cpp b/tests/localizationTagsProvider/tests_miscunit.cpp index ba7a1d8..430cccf 100644 --- a/tests/localizationTagsProvider/tests_miscunit.cpp +++ b/tests/localizationTagsProvider/tests_miscunit.cpp @@ -26,7 +26,7 @@ int main (int argc, char *argv[]) { - LogInfo("Starting miscellaneous unit tests"); + LogDebug("Starting miscellaneous unit tests"); int status = DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv); return status; diff --git a/tests/unused/test_message_queue.cpp b/tests/unused/test_message_queue.cpp index 3322413..09990b7 100644 --- a/tests/unused/test_message_queue.cpp +++ b/tests/unused/test_message_queue.cpp @@ -69,13 +69,13 @@ class CopyThread : m_output(output), m_dataSize(dataSize) { - LogInfo("Thread created"); + LogDebug("Thread created"); } protected: virtual int ThreadEntry() { - LogInfo("Entering copy thread"); + LogDebug("Entering copy thread"); Try { @@ -89,7 +89,7 @@ class CopyThread : return 0; } - LogInfo("Copy finished"); + LogDebug("Copy finished"); return 0; } }; diff --git a/tests/unused/test_shm.cpp b/tests/unused/test_shm.cpp index a5c6046..79b40f6 100644 --- a/tests/unused/test_shm.cpp +++ b/tests/unused/test_shm.cpp @@ -1552,7 +1552,7 @@ RUNNER_TEST(SharedMemory_130_SharedObjectSingleton) // Create and wait for notification. Make sure that the thread/controller 0 // is created first - LogInfo("Creating controllers"); + LogDebug("Creating controllers"); for (size_t i = 0; i < MAX_THREADS; ++i) { controller[i] = new ShmController4(&waitable[i]); Wait(waitable[i]); @@ -1562,12 +1562,12 @@ RUNNER_TEST(SharedMemory_130_SharedObjectSingleton) MTSharedObjectPtr singleton = SharedObjectSingleton::Instance(); for (size_t repeats = 0; repeats < SINGLETON_TEST_REPEATS; ++repeats) { - LogInfo("%%%%%%%%%%%%%%%%%%%%%"); - LogInfo("Iteration " << repeats + 1 << " of " << SINGLETON_TEST_REPEATS); + LogDebug("%%%%%%%%%%%%%%%%%%%%%"); + LogDebug("Iteration " << repeats + 1 << " of " << SINGLETON_TEST_REPEATS); singleton->Clear(); // add listeners - LogInfo("Adding listeners"); + LogDebug("Adding listeners"); for (size_t i = 0; i < MAX_THREADS; ++i) { controller[i]->PostEvent(ShmController4::ADD_LISTENERS); } @@ -1585,31 +1585,31 @@ RUNNER_TEST(SharedMemory_130_SharedObjectSingleton) RUNNER_ASSERT(checkArray[2] == 0); // change - LogInfo("Setting property 0"); + LogDebug("Setting property 0"); sho->SetProperty<0>(1); // wait for confirmations MultipleWait(waitable); // change - LogInfo("Setting property 1"); + LogDebug("Setting property 1"); sho->SetProperty<1>(11); // wait for confirmations MultipleWait(waitable); // change - LogInfo("Setting property 2"); + LogDebug("Setting property 2"); sho->SetProperty<2>('a'); // wait for confirmations MultipleWait(waitable); // change - LogInfo("Setting property 3"); + LogDebug("Setting property 3"); sho->SetProperty<3>(array); // wait for confirmations MultipleWait(waitable); // remove listeners - LogInfo("Removing listeners"); + LogDebug("Removing listeners"); for (size_t i = 0; i < MAX_THREADS; ++i) { controller[i]->PostEvent(ShmController4::REMOVE_LISTENERS); } @@ -1617,7 +1617,7 @@ RUNNER_TEST(SharedMemory_130_SharedObjectSingleton) MultipleWait(waitable); // check if listeners array is empty - LogInfo("Checking listeners"); + LogDebug("Checking listeners"); for (size_t i = 0; i < MAX_THREADS; ++i) { LISTENER_ASSERT(0); LISTENER_ASSERT(1); @@ -1638,7 +1638,7 @@ RUNNER_TEST(SharedMemory_130_SharedObjectSingleton) // Destroy controllers and wait for confirmation. Make sure that // thread/controller 0 is destroyed in the end - LogInfo("Destroying controllers"); + LogDebug("Destroying controllers"); for (int i = MAX_THREADS - 1; i >= 0; --i) { controller[i]->PostEvent(DESTROY_EVENT); Wait(waitable[i]); @@ -1648,7 +1648,7 @@ RUNNER_TEST(SharedMemory_130_SharedObjectSingleton) * This is to properly close all waitable handles opened by * SharedObject in thread 0. */ - LogInfo("Destroying singleton"); + LogDebug("Destroying singleton"); controller[i]->PostEvent(ShmController4::DESTROY_SINGLETON); Wait(waitable[i]); } diff --git a/tests/unused/test_task.cpp b/tests/unused/test_task.cpp index 995f1cb..a885dcd 100644 --- a/tests/unused/test_task.cpp +++ b/tests/unused/test_task.cpp @@ -48,17 +48,17 @@ class MyMultiTask : void StepOne() { - LogInfo("Step one"); + LogDebug("Step one"); } void StepTwo() { - LogInfo("Step two"); + LogDebug("Step two"); } void StepThree() { - LogInfo("Step three"); + LogDebug("Step three"); } public: -- 2.7.4