IWacSecurity interface name change to IWidgetSecurity
authorTomasz Iwanek <t.iwanek@samsung.com>
Wed, 10 Jul 2013 10:10:53 +0000 (12:10 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 15 Jul 2013 14:09:59 +0000 (14:09 +0000)
[Issue#]       LINUXWRT-629
[Bug]          This code is not longer connect with wac functionality
[Cause]        N/A
[Solution]     Name change of interface.
[Verification] Build repo. Build wrt-installer basing on this change.

Change-Id: Ib46c3c910e8baf5a8bf98c57f051fd987aefe5ad

modules/widget_dao/dao/widget_dao.cpp
modules/widget_dao/dao/widget_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h
modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h
tests/dao/TestCases_WidgetDAO.cpp

index 87d39bd..1061fe0 100644 (file)
@@ -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<DbWidgetHandle> 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")
@@ -376,7 +376,7 @@ void WidgetDAO::registerWidgetExtendedInfo(DbWidgetHandle widgetHandle,
 DbWidgetHandle WidgetDAO::registerWidgetInfo(
     const TizenAppId & tzAppId,
     const WidgetRegisterInfo &regInfo,
-    const IWacSecurity &wacSecurity,
+    const IWidgetSecurity &widgetSecurity,
     const DPL::Optional<DbWidgetHandle> handle)
 {
     using namespace DPL::DB::ORM;
@@ -405,8 +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_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);
     {
@@ -646,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);
index d7941c5..5b3ffa1 100644 (file)
@@ -178,7 +178,7 @@ TizenPkgId getTizenPkgIdByHandle(const DbWidgetHandle handle)
 }
 } // namespace
 
-IWacSecurity::~IWacSecurity()
+IWidgetSecurity::~IWidgetSecurity()
 {}
 
 WidgetDAOReadOnly::WidgetDAOReadOnly(DbWidgetHandle widgetHandle) :
index d502b55..1d07219 100644 (file)
@@ -182,10 +182,10 @@ struct WidgetRegisterInfo
 };
 
 typedef std::list<std::string> CertificateChainList;
-class IWacSecurity
+class IWidgetSecurity
 {
   public:
-    virtual ~IWacSecurity();
+    virtual ~IWidgetSecurity();
 
     virtual const WidgetCertificateDataList& getCertificateList() const = 0;
 
@@ -197,6 +197,9 @@ class IWacSecurity
                                          CertificateSource source) const = 0;
 };
 
+//TODO: remove this typedef after wrt-installer changes...
+typedef IWidgetSecurity IWacSecurity;
+
 /**
  * WidgetAuthorInfo.
  * Structure to hold the information of widget's author.
index 9830f68..42fb635 100644 (file)
@@ -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 &regInfo,
-        const IWacSecurity &wacSecurity,
+        const IWidgetSecurity &widgetSecurity,
         const DPL::Optional<DbWidgetHandle> handle =
             DPL::Optional<DbWidgetHandle>());
     static void registerWidgetExtendedInfo(
@@ -203,7 +203,7 @@ class WidgetDAO : public WidgetDAOReadOnly
         const WidgetRegisterInfo &regInfo);
     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<DbWidgetHandle> handle =
             DPL::Optional<DbWidgetHandle>());
     static void unregisterWidgetInternal(
index b675d6a..7e1f603 100644 (file)
@@ -36,7 +36,7 @@
 using namespace WrtDB;
 
 namespace {
-class WacSecurityMock : public WrtDB::IWacSecurity
+class WacSecurityMock : public WrtDB::IWidgetSecurity
 {
   public:
     WacSecurityMock() :
@@ -85,7 +85,7 @@ class WacSecurityMock : public WrtDB::IWacSecurity
 };
 
 TizenAppId _registerWidget(const WidgetRegisterInfo& regInfo,
-                           const IWacSecurity& sec,
+                           const IWidgetSecurity& sec,
                            int line)
 {
     TizenAppId tizenAppId;