Replace ipc message to read static value 06/10206/1
authorJihoon Chung <jihoon.chung@samsung.com>
Sat, 1 Jun 2013 11:16:08 +0000 (20:16 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Tue, 24 Sep 2013 12:35:13 +0000 (21:35 +0900)
[Issue#] N/A
[Problem] launch.application API is crashed
[Cause] During send IPC from plugin, UI process send
Messages::WebPage::HitTestResultAtPoint to WebProcess.
Conlict is occurred during dispatch IPC message.
[Solution] Replace IPC to get x window handle to static value
[SCMRequest] N/A

Change-Id: I350bf6400887729154b4d05929bded98f976002f

src/plugins-ipc-message/ipc_message_support.cpp
src/plugins-ipc-message/ipc_message_support.h

index db1e8a8..a6b1fa1 100644 (file)
@@ -30,6 +30,7 @@
 #include <dpl/assert.h>
 
 static WKBundleRef s_injectedBundleRef = NULL;
+static unsigned  int s_xWindowHandle = 0;
 
 namespace {
 std::string toString(WKStringRef str)
@@ -50,6 +51,12 @@ void IPCMessageSupport::setWKBundleRef(WKBundleRef bundleRef)
     s_injectedBundleRef = bundleRef;
 }
 
+void IPCMessageSupport::setXwindowHandle(unsigned int handle)
+{
+    LogDebug("setXwindowHandle called");
+    s_xWindowHandle = handle;
+}
+
 const char* IPCMessageSupport::sendMessageToUiProcess(
     const char* name,
     const char* body)
@@ -65,6 +72,18 @@ const char* IPCMessageSupport::sendMessageToUiProcess(
     if (!name) {
         return NULL;
     }
+
+    if (!strcmp(name, "tizen://getWindowHandle")) {
+        if (s_xWindowHandle == 0) {
+            return NULL;
+        } else {
+            std::stringstream ss;
+            ss << s_xWindowHandle;
+            std::string ret  = ss.str();
+            return strdup(ret.c_str());
+        }
+    }
+
     WKStringRef bodyWKString = NULL;
     WKStringRef nameWKString = WKStringCreateWithUTF8CString(name);
     if (body) {
index 0bde70a..fa96e3f 100644 (file)
@@ -27,6 +27,7 @@
 
 namespace IPCMessageSupport {
 void setWKBundleRef(WKBundleRef bundleRef);
+void setXwindowHandle(unsigned int handle);
 const char* sendMessageToUiProcess(const char* name, const char* body);
 }