[Release] wrt_0.8.186
authorJihoon Chung <jihoon.chung@samsung.com>
Mon, 22 Apr 2013 09:29:06 +0000 (18:29 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Mon, 22 Apr 2013 09:29:06 +0000 (18:29 +0900)
15 files changed:
packaging/wrt.spec
src/api_new/core_module.cpp
src/api_new/core_module.h
src/api_new/ewk_context_manager.cpp
src/domain/widget_data_types.cpp
src/domain/widget_data_types.h
src/domain/widget_deserialize_model.cpp
src/domain/widget_deserialize_model.h
src/domain/widget_model.cpp
src/domain/widget_model.h
src/view/common/view_logic_uri_support.cpp
src/view/webkit/bundles/wrt-wk2-bundle.cpp
src/view/webkit/view_logic_service_support.cpp
src/wrt-client/wrt-client.cpp
src/wrt-client/wrt-client.h

index 1d811f3..9c61f22 100644 (file)
@@ -1,7 +1,7 @@
-#git:framework/web/wrt wrt_0.8.185
+#git:framework/web/wrt wrt_0.8.186
 Name:       wrt
 Summary:    web runtime
-Version:    0.8.185
+Version:    0.8.186
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index eed7108..b71c2c9 100644 (file)
@@ -29,6 +29,7 @@
 #include <dpl/assert.h>
 #include <dpl/exception.h>
 #include <dpl/singleton_impl.h>
+#include <dpl/optional_typedefs.h>
 #include "localization_setting.h"
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <profiling_util.h>
@@ -127,23 +128,15 @@ class CoreModuleImpl
         MainThreadSingleton::Instance().DetachDatabases();
         m_initialized = false;
     }
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
+
     RunnableWidgetObjectPtr getRunnableWidgetObject(
         const std::string& tizenId,
-        DPL::Optional<unsigned> serviceIndex)
-#else
-    RunnableWidgetObjectPtr getRunnableWidgetObject(
-        const std::string& tizenId)
-#endif
+        DPL::OptionalUInt appControlIndex)
     {
         try {
             RunnableWidgetObjectPtr runnable;
             WidgetModelPtr model =
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-                Domain::deserializeWidgetModel(tizenId, serviceIndex);
-#else
-                Domain::deserializeWidgetModel(tizenId);
-#endif
+                Domain::deserializeWidgetModel(tizenId, appControlIndex);
             if (!!model) {
                 runnable.reset(new RunnableWidgetObject(model));
             }
@@ -211,20 +204,12 @@ void CoreModule::Terminate()
 {
     return m_impl->Terminate();
 }
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
+
 RunnableWidgetObjectPtr CoreModule::getRunnableWidgetObject(
     const std::string& tizenId,
-    DPL::Optional<unsigned> serviceIndex)
-#else
-RunnableWidgetObjectPtr CoreModule::getRunnableWidgetObject(
-    const std::string& tizenId)
-#endif
+    DPL::OptionalUInt appControlIndex)
 {
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-    return m_impl->getRunnableWidgetObject(tizenId, serviceIndex);
-#else
-    return m_impl->getRunnableWidgetObject(tizenId);
-#endif
+    return m_impl->getRunnableWidgetObject(tizenId, appControlIndex);
 }
 
 CoreModule::NetworkAccessMode CoreModule::homeNetworkAccess()
index 0da83f3..a29e086 100644 (file)
@@ -27,6 +27,7 @@
 #include <dpl/wrt-dao-ro/wrt_db_types.h>
 #include "i_runnable_widget_object.h"
 #include <dpl/singleton.h>
+#include <dpl/optional_typedefs.h>
 #include <memory>
 
 #include <EWebKit2.h>
@@ -66,14 +67,9 @@ class CoreModule
      * @param packageName
      * @return NULL on fail
      */
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
     RunnableWidgetObjectPtr getRunnableWidgetObject(
         const std::string& tizenId,
-        DPL::Optional<unsigned> serviceIndex);
-#else
-    RunnableWidgetObjectPtr getRunnableWidgetObject(
-        const std::string& tizenId);
-#endif
+        DPL::OptionalUInt appControlIndex = DPL::OptionalUInt());
     /**
      * Gets from database global property of homeNetworkAccess
      * @return homeNetworkAccess value
index 8a03146..60ea6a1 100644 (file)
@@ -219,7 +219,7 @@ void EwkContextManager::setBackgroundSupport()
         return;
     }
 
-    WidgetSettings widgetSettings;
+    WrtDB::WidgetSettings widgetSettings;
     dao.getWidgetSettings(widgetSettings);
     WidgetSettingList settings(widgetSettings);
     bool backgroundSupport = false;
index 3a36be3..7ebbb6d 100644 (file)
@@ -101,7 +101,7 @@ WidgetSettingList::WidgetSettingList() :
     m_BackgroundSupport(BackgroundSupport_Disable)
 {}
 
-WidgetSettingList::WidgetSettingList(WidgetSettings &widgetSettings)
+WidgetSettingList::WidgetSettingList(WrtDB::WidgetSettings &widgetSettings)
 {
     m_RotationLock = Screen_Portrait;
     m_IndicatorPresence = Indicator_Enable;
index 101d9fc..6072b1c 100644 (file)
@@ -171,7 +171,7 @@ class WidgetSettingList
   public:
     WidgetSettingList();
 
-    WidgetSettingList(WidgetSettings &widgetSettings);
+    WidgetSettingList(WrtDB::WidgetSettings &widgetSettings);
 
     WidgetSettingScreenLock getRotationValue() const;
 
index 06c4f8a..5cf31a2 100644 (file)
 
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 #include <dpl/log/log.h>
+#include <dpl/optional_typedefs.h>
 // to apply widget default locales instead of calling localizeWidgetModel()
 #include <dpl/localization/LanguageTagsProvider.h>
 
 namespace Domain {
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
 std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId,
-                                                    DPL::Optional<unsigned> serviceIndex)
-#else
-std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId)
-#endif
+                                                    DPL::OptionalUInt appControlIndex)
 {
     std::shared_ptr<WidgetModel> model;
     DPL::String dplTizenId(DPL::FromUTF8String(tizenId));
     if (WrtDB::WidgetDAOReadOnly::isWidgetInstalled(dplTizenId)) {
         LogDebug("Widget installed - creating model");
         model.reset(new WidgetModel(tizenId));
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-        model->AppServiceIndex.Set(serviceIndex);
-#endif
+        model->AppControlIndex.Set(appControlIndex);
 
         WrtDB::WidgetDAOReadOnly dao(dplTizenId);
         DPL::Optional<DPL::String> defloc = model->defaultlocale.Get();
@@ -56,14 +51,14 @@ std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId)
         dao.getWidgetAccessInfo(widgetAccessInfoList);
         model->AccessList.Set(widgetAccessInfoList);
 
-        // Widget application service information data
-        WidgetApplicationServiceList widgetApplicationServiceList;
-        // widgetApplicationServiceList is output parameter
-        dao.getAppServiceList(widgetApplicationServiceList);
-        model->AppServiceList.Set(widgetApplicationServiceList);
+        // Widget app-control information data
+        WrtDB::WidgetAppControlList widgetApplicationControlList;
+        // widgetApplicationControlList is output parameter
+        dao.getAppControlList(widgetApplicationControlList);
+        model->AppControlList.Set(widgetApplicationControlList);
 
         // Set Widget Settings
-        WidgetSettings widgetSettings;
+        WrtDB::WidgetSettings widgetSettings;
         dao.getWidgetSettings(widgetSettings);
         model->SettingList.Set(widgetSettings);
     } else {
index dca79a6..939974d 100644 (file)
@@ -26,6 +26,7 @@
 #include <string>
 #include <widget_model.h>
 #include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include <dpl/optional_typedefs.h>
 
 namespace Domain {
 /**
@@ -34,12 +35,8 @@ namespace Domain {
  * @param[in] service index, NULL for widget content
  * @retval WidgetModel
  */
- #ifdef MULTIPROCESS_SERVICE_SUPPORT
  std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId,
-                                                     DPL::Optional<unsigned> serviceIndex);
- #else
-std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId);
- #endif
+                                                     DPL::OptionalUInt appControlIndex=DPL::OptionalUInt());
 } //Namespace Domain
 
 #endif // ifndef WRT_ENGINE_SRC_DOMAIN_WIDGET_DESERIALIZE_MODEL_H_
index e7053db..0bae26f 100644 (file)
@@ -134,10 +134,8 @@ WidgetModel::WidgetModel(const std::string &tizenId) :
         BindToWidgetDAO<bool, &WidgetDAOReadOnly::isTestWidget>::Get),
 
     SettingList(this),
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-    AppServiceIndex(this),
-#endif
-    AppServiceList(this)
+    AppControlList(this),
+    AppControlIndex(this)
 
 {}
 
index 0c973fc..536a1bc 100644 (file)
@@ -25,6 +25,7 @@
 #include <dpl/event/model.h>
 #include <dpl/event/property.h>
 #include <dpl/optional.h>
+#include <dpl/optional_typedefs.h>
 #include <string>
 
 #include "widget_data_types.h"
@@ -227,12 +228,11 @@ class WidgetModel : public DPL::Event::Model
     DPL::Event::Property<WidgetSettingList> SettingList;
 
     /**
-     * @brief Widget Application Service list
+     * @brief Widget app-control list
      */
-    DPL::Event::Property<WidgetApplicationServiceList> AppServiceList;
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-    DPL::Event::Property<DPL::Optional<unsigned> > AppServiceIndex;
-#endif
+    DPL::Event::Property<WrtDB::WidgetAppControlList> AppControlList;
+    DPL::Event::Property<DPL::OptionalUInt> AppControlIndex;
+
     WidgetModel(const std::string &tizenId);
 
   private:
index be9f538..d0bb34f 100644 (file)
@@ -26,6 +26,7 @@
 #include <dpl/string.h>
 #include <dpl/log/log.h>
 #include <dpl/localization/w3c_file_localization.h>
+#include <dpl/optional_typedefs.h>
 #include <widget_model.h>
 #include <bundle.h>
 #include <appsvc.h>
 namespace ViewModule {
 namespace UriSupport {
 namespace {
+struct AppControlCompareData {
+std::string operation;
+std::string uri;
+std::string scheme;
+std::string mime;
+};
 enum ServiceDataType
 {
     SERVICE_DATA_TYPE_OPERATION,
@@ -108,6 +115,37 @@ bool compareServiceData(ServiceDataType type,
         return false;
     }
 }
+
+std::string getAppControlSrc(
+    WrtDB::WidgetAppControlList appControlLost,
+    AppControlCompareData data)
+{
+    LogDebug(" - operation : " << data.operation);
+    LogDebug(" - uri       : " << data.uri);
+    LogDebug(" - scheme    : " << data.scheme);
+    LogDebug(" - mimetype  : " << data.mime);
+
+    FOREACH(appControlIt, appControlLost)
+    {
+        if (compareServiceData(SERVICE_DATA_TYPE_OPERATION, DPL::ToUTF8String(appControlIt->operation), data.operation))
+        {
+            if (compareServiceData(SERVICE_DATA_TYPE_URI_SCHEME, DPL::ToUTF8String(appControlIt->uri), data.scheme) ||
+                compareServiceData(SERVICE_DATA_TYPE_URI, DPL::ToUTF8String(appControlIt->uri), data.uri) )
+            {
+                if (compareServiceData(SERVICE_DATA_TYPE_MIME, DPL::ToUTF8String(appControlIt->mime), data.mime))
+                {
+                    LogDebug("Matched with : " << appControlIt->src);
+                    LogDebug(" - operation : " << appControlIt->operation);
+                    LogDebug(" - uri       : " << appControlIt->uri);
+                    LogDebug(" - mimetype  : " << appControlIt->mime);
+                    return DPL::ToUTF8String(appControlIt->src);
+                }
+            }
+        }
+    }
+    return std::string();
+}
+
 }
 
 std::string prepareUrl(const std::string &url, const std::string &insert)
@@ -161,7 +199,7 @@ std::string getCustomHandlerContentUri(
     return "";
 }
 
-std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
+std::string getAppControlUri(bundle *bundle, WidgetModel *widgetModel)
 {
     if (!bundle)
     {
@@ -169,104 +207,154 @@ std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
         return std::string("");
     }
 
+    AppControlCompareData data;
+    // get operation. Operation is mandatory.
     const char* value = NULL;
     value = appsvc_get_operation(bundle);
-    std::string operation = value ? value : "";
-    if (operation.empty()) {
+    data.operation = value ? value : "";
+    // ignore operation is NULL case
+    if (data.operation.empty()) {
+        LogDebug("Operation is NULL");
         return std::string("");
     }
 
+    // get mime
     value = appsvc_get_mime(bundle);
-    std::string mime = value ? value : "";
+    data.mime = value ? value : "";
 
+    // get uri
     value = appsvc_get_uri(bundle);
-    std::string uri = value ? value : "";
-    std::string scheme;
+    data.uri = value ? value : "";
 
-    if (uri.empty()) {
-        LogError("Launch with no bundle data");
-    } else {
-        // get scheme by iri
-        std::unique_ptr<iri_t> iri(iri_parse(uri.c_str()));
+    LogDebug("Passed AppControl data");
+    LogDebug(" - operation : " << data.operation);
+    LogDebug(" - uri       : " << data.uri);
+    LogDebug(" - mimetype  : " << data.mime);
+
+
+    // get scheme and mime
+    std::string originScheme = "";
+    std::string originPath = "";
+    if (!data.uri.empty()) {
+        std::unique_ptr<iri_t> iri(iri_parse(data.uri.c_str()));
         if (!iri.get()) {
             LogDebug("Fail to get iri");
-            return std::string("");
+            originScheme = "";
+            originPath = "";
         }
         if (iri->scheme) {
-            if (std::string(iri->scheme) != SCHEME_TYPE_FILE) {
-                scheme = iri->scheme;
-            }
+            originScheme = iri->scheme;
         }
         if (iri->path) {
-            uri = iri->path;
+            originPath = iri->path;
         }
-    }
 
-    // get mime type by aul api in case of mime type is empty
-    if (mime.empty() && !uri.empty()) {
-        char mimetype[128] = {0,};
-        if (AUL_R_OK ==
-            aul_get_mime_from_file(uri.c_str(),
-                                   mimetype,
-                                   sizeof(mimetype)))
-        {
-            mime = mimetype;
+        // checking condition that mime is empthy and uri is available
+        if (data.mime.empty() && !data.uri.empty()) {
+            // checking passed uri is local file
+            // case 1. uri = file:///xxxx
+            // case 2. uri = /xxxx
+            if (!data.scheme.empty() && data.scheme != SCHEME_TYPE_FILE) {
+                LogDebug("Passed uri isn't local file");
+            } else {
+                char mimetype[128] = {0,};
+                if (AUL_R_OK ==
+                    aul_get_mime_from_file(iri->path,
+                                           mimetype,
+                                           sizeof(mimetype)))
+                {
+                    data.mime = mimetype;
+                }
+            }
         }
     }
 
-    LogDebug("AppService Information");
-    LogDebug(" - operation : " << operation);
-    LogDebug(" - uri       : " << uri);
-    LogDebug(" - scheme    : " << scheme);
-    LogDebug(" - mimetype  : " << mime);
-
-    WidgetApplicationServiceList appServiceList = widgetModel->AppServiceList.Get();
-
+    WrtDB::WidgetAppControlList appControlList =
+        widgetModel->AppControlList.Get();
+    if (!appControlList.empty()) {
 #ifdef MULTIPROCESS_SERVICE_SUPPORT
-    DPL::Optional<unsigned> index = widgetModel->AppServiceIndex.Get();
-    if (!index.IsNull())
-    {
-        FOREACH(appServiceIt, appServiceList)
-        {
-            if (appServiceIt->index == *index)
-            {
-                return DPL::ToUTF8String(appServiceIt->src);
+        DPL::OptionalUInt index = widgetModel->AppControlIndex.Get();
+        if (!index.IsNull()) {
+            FOREACH(appControlIt, appControlList) {
+                if (appControlIt->index == *index) {
+                    return DPL::ToUTF8String(appControlIt->src);
+                }
             }
         }
-    }
 #else
-    FOREACH(appServiceIt, appServiceList)
-    {
-        if (compareServiceData(SERVICE_DATA_TYPE_OPERATION, DPL::ToUTF8String(appServiceIt->operation), operation))
-        {
-            if (compareServiceData(SERVICE_DATA_TYPE_URI_SCHEME, DPL::ToUTF8String(appServiceIt->scheme), scheme) ||
-                compareServiceData(SERVICE_DATA_TYPE_URI, DPL::ToUTF8String(appServiceIt->scheme), uri) )
-            {
-                if (compareServiceData(SERVICE_DATA_TYPE_MIME, DPL::ToUTF8String(appServiceIt->mime), mime))
-                {
-                    LogDebug("AppService Matched with : " << appServiceIt->src);
-                    LogDebug(" - operation : " << appServiceIt->operation);
-                    LogDebug(" - scheme    : " << appServiceIt->scheme);
-                    LogDebug(" - mimetype  : " << appServiceIt->mime);
+        // case 0, operation only
+        // scheme =
+        // uri    =
+        if (data.uri.empty()) {
+            LogDebug("AppControl case 0 (NULL, NULL)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+            return std::string();
+        }
 
-                    return DPL::ToUTF8String(appServiceIt->src);
-                }
+        // case 1
+        // scheme = nfc
+        // uri    = nfc:///xxx/xxx
+        if (!originScheme.empty()) {
+            data.scheme = originScheme;
+            LogDebug("AppControl case 1 (file, file:///xxx/xxx)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+        }
+
+        // case 2
+        // scheme =
+        // uri    = file:///xxx/xxx
+        data.scheme = "";
+        LogDebug("AppControl case 2 (NULL, file:///xxx/xxx)");
+        std::string src = getAppControlSrc(appControlList, data);
+        if (!src.empty()) {
+            return src;
+        }
+
+        // case 3
+        // scheme = file
+        // uri    = /xxx/xxx
+        if (!originScheme.empty() && !originPath.empty()) {
+            data.scheme = originScheme;
+            data.uri = originPath;
+            LogDebug("AppControl case 3 (file, /xxx/xxx)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+        }
+
+        // case 4
+        // scheme =
+        // uri    = /xxx/xxx
+        if (!originPath.empty()) {
+            data.scheme = "";
+            data.uri = originPath;
+            LogDebug("AppControl case 4 (NULL, /xxx/xxx)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
             }
         }
-    }
 #endif
+    }
 
-    if (!scheme.empty()) {
-        LogDebug("Scheme parts: " << scheme << ", " << uri);
+    if (!originScheme.empty()) {
+        LogDebug("Scheme parts: " << originScheme << ", " << originPath);
         return getCustomHandlerProtocolUri(
-                   widgetModel, scheme, uri);
+                   widgetModel, originScheme, originPath);
     }
-    if (mime != "") {
+    if (data.mime != "") {
         value = appsvc_get_data(bundle, APPSVC_DATA_SELECTED);
         if (value != NULL) {
             LogDebug("Use mime type for: " << value);
             return getCustomHandlerContentUri(
-                       widgetModel, mime, std::string(value));
+                       widgetModel, data.mime, std::string(value));
         } else {
             LogError("Selected file for mime is null, nothind to do");
         }
@@ -281,11 +369,11 @@ std::string getUri(WidgetModel *widgetModel, const std::string &defaultUri)
     std::string startUri;
     LogDebug("default uri: " << defaultUri);
     bundle *originBundle = ApplicationDataSingleton::Instance().getBundle();
-    // search application service
-    startUri = getAppServiceUri(originBundle, widgetModel).c_str();
-    LogInfo("application service start uri is " << startUri);
+    // search app-control data
+    startUri = getAppControlUri(originBundle, widgetModel).c_str();
+    LogInfo("app-control start uri is " << startUri);
     if (startUri == "") {
-        LogInfo("application service doesn't have matched data");
+        LogInfo("app-control data doesn't have matched data");
         startUri = defaultUri;
     }
 
index 5b8c9b4..6256217 100644 (file)
@@ -498,13 +498,19 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
                 std::string appPath;
                 std::string tzAppId = DPL::ToUTF8String(dao.getTzAppId());
                 std::string tzPkgId = DPL::ToUTF8String(dao.getTizenPkgId());
-
-                appPath = appPath + GetUserInstalledWidgetPath() + "/" +
-                          tzPkgId + GetUserWidgetExecPath() + "/" + tzAppId;
+                DPL::OptionalString installedPath = dao.getWidgetInstalledPath();
+                if (installedPath.IsNull()) {
+                    appPath = std::string(GetUserInstalledWidgetPath()) + "/" +
+                        tzPkgId + GetUserWidgetExecPath() + "/" + tzAppId;
+                } else {
+                    appPath = DPL::ToUTF8String(*installedPath) +
+                        GetUserWidgetExecPath() + "/" + tzAppId;
+                }
 
                 LogDebug("set_app_privilege(" << appPath << ")");
                 set_app_privilege(tzPkgId.c_str(), PRIVILEGE_APP_TYPE, appPath.c_str());
             }
+
 #ifdef CORS_WHITELISTING_ENABLED
             bypassCORSforWARPAccessList(dao);
 #endif
index c5f184c..3f55d2c 100644 (file)
@@ -178,15 +178,15 @@ Disposition disposition(WidgetModel *model)
 {
     Assert(model);
     Assert(isService(model));
-    WidgetApplicationServiceList appServiceList = model->AppServiceList.Get();
-    unsigned index = *model->AppServiceIndex.Get();
-    FOREACH(appServiceIt, appServiceList)
+    WrtDB::WidgetAppControlList appControlList = model->AppControlList.Get();
+    unsigned index = *model->AppControlIndex.Get();
+    FOREACH(appControlIt, appControlList)
     {
-        if (index == appServiceIt->index)
+        if (index == appControlIt->index)
         {
-            switch(appServiceIt->disposition) {
-            case WidgetApplicationService::Disposition::INLINE:
-                LogDebug("Service disposition: INLINE");
+            switch(appControlIt->disposition) {
+            case WrtDB::WidgetAppControl::Disposition::INLINE:
+                LogDebug("Control disposition: INLINE");
                 return INLINE;
             default:
                 break;
@@ -213,7 +213,7 @@ int callerPID(bundle *b)
 
 bool isService(WidgetModel *model)
 {
-    return !model->AppServiceIndex.Get().IsNull();
+    return !model->AppControlIndex.Get().IsNull();
 }
 
 }
index 3519779..dd55a93 100644 (file)
@@ -72,6 +72,7 @@ const char* const APP_HOME_PATH = "/opt/home/app";
 WrtClient::WrtClient(int argc, char **argv) :
     Application(argc, argv, "wrt-client", false),
     DPL::TaskDecl<WrtClient>(this),
+    m_appControlIndex(DPL::OptionalUInt()),
     m_launched(false),
     m_initializing(false),
     m_initialized(false),
@@ -191,20 +192,18 @@ bool WrtClient::checkArgument()
         // Just show help
         return false;
     } else {
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-        const char * SERVICE_POSTFIX = "-__SERVICE_PROCESS__";
-        std::size_t pos = tizenId.find(SERVICE_POSTFIX);
+        std::size_t pos =
+            tizenId.find(WrtDB::AppControlPrefix::PROCESS_PREFIX);
         if (pos != std::string::npos) {
             std::string id = tizenId.substr(pos);
-            id.erase(strlen(SERVICE_POSTFIX));
+            id.erase(strlen(WrtDB::AppControlPrefix::PROCESS_PREFIX));
             std::stringstream s(id);
-            unsigned serviceIndex;
-            s >> serviceIndex;
-            m_serviceIndex = serviceIndex;
+            unsigned int appControlIndex;
+            s >> appControlIndex;
+            m_appControlIndex = appControlIndex;
             tizenId.erase(pos);
-            LogDebug("service index " << serviceIndex);
+            LogDebug("app-control execute-index : " << appControlIndex);
         }
-#endif
         m_tizenId = tizenId;
         LogDebug("Tizen id: " << m_tizenId);
         return true;
@@ -478,13 +477,8 @@ void WrtClient::launchStep()
     LogDebug("Launching widget ...");
 
     ADD_PROFILING_POINT("getRunnableWidgetObject", "start");
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-    m_widget = WRT::CoreModuleSingleton::Instance()
-            .getRunnableWidgetObject(m_tizenId, m_serviceIndex);
-#else
     m_widget = WRT::CoreModuleSingleton::Instance()
-        .getRunnableWidgetObject(m_tizenId);
-#endif
+            .getRunnableWidgetObject(m_tizenId, m_appControlIndex);
     ADD_PROFILING_POINT("getRunnableWidgetObject", "stop");
 
     if (!m_widget) {
@@ -613,7 +607,7 @@ void WrtClient::initializeWindowModes()
     bool fullscreen = false;
     bool backbutton = false;
     if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
-        WidgetSettings widgetSettings;
+        WrtDB::WidgetSettings widgetSettings;
         m_dao->getWidgetSettings(widgetSettings);
         WidgetSettingList settings(widgetSettings);
         backbutton =
@@ -663,7 +657,7 @@ void WrtClient::setOrientationWindow(void)
     Assert(m_windowData);
     Assert(m_dao);
 
-    WidgetSettings widgetSettings;
+    WrtDB::WidgetSettings widgetSettings;
     m_dao->getWidgetSettings(widgetSettings);
     WidgetSettingList settings(widgetSettings);
     WidgetSettingScreenLock rotationValue = settings.getRotationValue();
@@ -687,7 +681,7 @@ void WrtClient::setOrientationEwk(void)
     Assert(m_widget);
     Assert(m_dao);
 
-    WidgetSettings widgetSettings;
+    WrtDB::WidgetSettings widgetSettings;
     m_dao->getWidgetSettings(widgetSettings);
     WidgetSettingList settings(widgetSettings);
     WidgetSettingScreenLock rotationValue = settings.getRotationValue();
@@ -710,7 +704,7 @@ void WrtClient::connectElmCallback()
 {
     Assert(m_windowData);
     Assert(m_dao);
-    WidgetSettings widgetSettings;
+    WrtDB::WidgetSettings widgetSettings;
     m_dao->getWidgetSettings(widgetSettings);
     WidgetSettingList settings(widgetSettings);
     if (settings.getBackButtonPresence() == BackButton_Enable) {
@@ -962,21 +956,18 @@ int main(int argc,
 
             std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv);
             PluginModuleSupport::init(s_preparedEwkContext, tizenId);
-
         }
         else
         {
             // This code is to fork a web process without exec.
             std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv);
-
-            if (!tizenId.empty())
-            {
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-                std::size_t pos = tizenId.find("-__SERVICE_PROCESS__");
+            if (!tizenId.empty()) {
+                std::size_t pos =
+                    tizenId.find(WrtDB::AppControlPrefix::PROCESS_PREFIX);
                 if (pos != std::string::npos) {
                     tizenId.erase(pos);
                 }
-#endif
+
                 LogDebug("Launching by fork mode");
                 // Language env setup
                 appcore_set_i18n("wrt-client", NULL);
index 97d00ee..984ce2b 100644 (file)
@@ -21,6 +21,7 @@
 #include <dpl/event/controller.h>
 #include <dpl/type_list.h>
 #include <dpl/task.h>
+#include <dpl/optional_typedefs.h>
 #include <bundle.h>
 #include <i_runnable_widget_object.h>
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
@@ -103,9 +104,8 @@ class WrtClient :
 
     // Private data
     std::string m_tizenId;
-#ifdef MULTIPROCESS_SERVICE_SUPPORT
-    DPL::Optional<unsigned> m_serviceIndex;
-#endif
+    DPL::OptionalUInt m_appControlIndex;
+
     bool m_launched;
     bool m_initializing;
     bool m_initialized;