Remove interval for box update and check appid of alarm register
[platform/framework/web/web-provider.git] / src / Core / BoxManager.cpp
index c0ac7d8..b6f3e17 100644 (file)
@@ -19,6 +19,7 @@
  */
 #include <string>
 #include <map>
+#include <ctime>
 #include <ewk_context.h>
 #include <Plugin/IBoxPluginFactory.h>
 #include <Plugin/box_plugin_interface.h>
@@ -77,7 +78,7 @@ bool BoxManager::doCommand(const request_cmd_type type, const BoxInfoPtr& boxInf
         result = requestChangePeriod(boxInfo->instanceId, boxInfo->period);
         break;
     case REQUEST_CMD_UPDATE_BOX:
-        result = requestUpdateBox(boxInfo->boxId);
+        result = requestUpdateBox(boxInfo->boxId, boxInfo->contentInfo);
         break;
     default:
         LogD("not available request type");
@@ -224,18 +225,21 @@ bool BoxManager::requestChangePeriod(std::string& instanceId, float period)
     return box->changePeriod(period);
 }
 
-bool BoxManager::requestUpdateBox(std::string& boxId)
+bool BoxManager::requestUpdateBox(std::string& boxId, std::string& contentInfo)
 {
     LogD("enter");
 
     IBoxPtr box;
     box.reset();
+
+    time_t requestTime = time(NULL);
+
     for (auto it = m_boxMap.begin(); it != m_boxMap.end(); ++it) {
         if (it->first.find(boxId) == std::string::npos) {
             continue;
         }
         box = it->second;
-        box->update();
+        box->update(requestTime, contentInfo);
     }
 
     return true;