[Release] wrt_0.8.230
authorJihoon Chung <jihoon.chung@samsung.com>
Sat, 29 Jun 2013 07:42:28 +0000 (16:42 +0900)
committerHoseon LEE <hoseon46.lee@samsung.com>
Sun, 29 Sep 2013 05:36:32 +0000 (14:36 +0900)
Change-Id: Ief5e568c5d4fdd4125360f54f5642537c2c62588

packaging/wrt.spec
src/view/webkit/CMakeLists.txt
src/view/webkit/injected-bundle/wrt-injected-bundle.cpp
src/view/webkit/view_logic.cpp

index 5b066f4..36b659b 100644 (file)
@@ -1,7 +1,7 @@
 #git:framework/web/wrt
 Name:       wrt
 Summary:    web runtime
-Version:    0.8.229
+Version:    0.8.230
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
@@ -42,6 +42,7 @@ BuildRequires:  pkgconfig(haptic)
 BuildRequires:  pkgconfig(capi-web-url-download)
 BuildRequires:  pkgconfig(wrt-plugin-loading)
 BuildRequires:  pkgconfig(wrt-plugin-js-overlay)
+BuildRequires:  pkgconfig(wrt-plugins-ipc-message)
 BuildRequires:  pkgconfig(wrt-popup-wrt-runner)
 BuildRequires:  pkgconfig(wrt-popup-ace-runner)
 BuildRequires:  pkgconfig(sysman)
index 66d9de1..a82f14e 100644 (file)
@@ -27,6 +27,7 @@ PKG_CHECK_MODULES(VIEW_MODULE_DEP
     notification
     wrt-commons-custom-handler-dao-rw
     wrt-dispatch-event
+    wrt-plugins-ipc-message
     wrt-plugin-js-overlay
     wrt-popup-wrt-runner
     security-core
index 9ddd6d4..bd13d0b 100644 (file)
@@ -532,6 +532,39 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
             m_viewmodesSupport->enterViewmodesAllPages(msgBody);
         }
     }
+    else if (WKStringIsEqualToUTF8CString(messageName, IPCMessageSupport::REPLY_ASYNC))
+    {
+        using namespace IPCMessageSupport;
+
+        std::string msgBody = toString(static_cast<WKStringRef>(messageBody));
+
+        if (msgBody.find_first_of('_') != std::string::npos)
+        {
+            std::string strHandle = msgBody.substr(0, msgBody.find_first_of('_'));
+            std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+            LogDebug("handle: " << strHandle << ", Body:" << strBody);
+
+            int handle = atoi(strHandle.c_str());
+
+            AsyncConnectionPtr connection = AsyncConnectionManager::instance().getConnection(handle);
+
+            if (connection)
+            {
+                if (connection->replyCallback)
+                {
+                    LogDebug("connection->replyCallback()");
+                    (connection->replyCallback)(handle, connection->data, strBody.c_str());
+                }
+
+                AsyncConnectionManager::instance().removeConnection(handle);
+            }
+            else
+            {
+                LogDebug("Connection is not available. Ignored.");
+            }
+        }
+    }
 }
 
 WKURLRequestRef Bundle::willSendRequestForFrameCallback(
index 75fdb66..8b00e3e 100644 (file)
@@ -70,6 +70,7 @@
 #include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
 #include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
 #include <popup-runner/PopupInvoker.h>
+#include <plugins-ipc-message/ipc_message_support.h>
 
 #include <appsvc/appsvc.h>
 #include <utilX.h>
@@ -561,6 +562,45 @@ void ViewLogic::checkAsyncMessageFromBundle(const char* name, const char* body)
         }
         ewk_cookie_manager_cookies_clear(cookieManager);
     }
+    else if (!strcmp(name, IPCMessageSupport::TIZEN_CHANGE_USERAGENT))
+    {
+        std::string msgBody = (body) ? (body) : "";
+
+        std::string strId = msgBody.substr(0, msgBody.find_first_of('_'));
+        std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+        LogDebug("Id: " << strId << ", Body:" << strBody);
+
+        ewk_view_user_agent_set(m_currentEwkView, strBody.c_str());
+
+        LogDebug("get UA: " << ewk_view_user_agent_get(m_currentEwkView));
+
+        IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "success");
+
+        return;
+    }
+    else if (!strcmp(name, IPCMessageSupport::TIZEN_DELETE_ALL_COOKIES))
+    {
+        std::string msgBody = (body) ? (body) : "";
+
+        std::string strId = msgBody.substr(0, msgBody.find_first_of('_'));
+        std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+        Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(m_ewkContext);
+
+        if (!cookieManager)
+        {
+            LogError("Fail to get cookieManager");
+            IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "error");
+
+            return;
+        }
+        ewk_cookie_manager_cookies_clear(cookieManager);
+
+        IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "success");
+
+        return;
+    }
 }
 
 void ViewLogic::downloadData(const char* url)