From 481211810a82319b0abc020fd32a887993dec8cb Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Sat, 29 Jun 2013 16:42:28 +0900 Subject: [PATCH] [Release] wrt_0.8.230 Change-Id: Ief5e568c5d4fdd4125360f54f5642537c2c62588 --- packaging/wrt.spec | 3 +- src/view/webkit/CMakeLists.txt | 1 + .../webkit/injected-bundle/wrt-injected-bundle.cpp | 33 ++++++++++++++++++ src/view/webkit/view_logic.cpp | 40 ++++++++++++++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) diff --git a/packaging/wrt.spec b/packaging/wrt.spec index 5b066f4..36b659b 100644 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -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) diff --git a/src/view/webkit/CMakeLists.txt b/src/view/webkit/CMakeLists.txt index 66d9de1..a82f14e 100644 --- a/src/view/webkit/CMakeLists.txt +++ b/src/view/webkit/CMakeLists.txt @@ -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 diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp index 9ddd6d4..bd13d0b 100644 --- a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp +++ b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp @@ -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(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( diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index 75fdb66..8b00e3e 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -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) -- 2.7.4