소스 검색

Adding IPC terminate, other process accessor

Josh Engebretson 9 년 전
부모
커밋
80eb2ac670
5개의 변경된 파일24개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 0
      CMakeLists.txt
  2. 2 0
      Source/Atomic/IPC/IPCChannel.h
  3. 3 1
      Source/Atomic/IPC/IPCUnix.h
  4. 11 0
      Source/Atomic/IPC/IPCWindows.cpp
  5. 3 1
      Source/Atomic/IPC/IPCWindows.h

+ 5 - 0
CMakeLists.txt

@@ -92,6 +92,11 @@ if (ATOMIC_WEBVIEW)
     include_directories (${CMAKE_SOURCE_DIR}/Submodules/CEF/Linux)
     add_subdirectory(Submodules/CEF/Linux/libcef_dll)
   endif()
+
+  if (ATOMIC_UWEBKIT)
+    add_subdirectory(Submodules/uWebKit/uWebKitNative)
+  endif()
+
 endif()
 
 add_subdirectory(Source)

+ 2 - 0
Source/Atomic/IPC/IPCChannel.h

@@ -58,6 +58,8 @@ public:
 
     void PostMessage(StringHash eventType, VariantMap& eventData);
 
+    IPCProcess* GetOtherProcess() { return otherProcess_; }
+
 protected:
 
     unsigned id_;

+ 3 - 1
Source/Atomic/IPC/IPCUnix.h

@@ -78,12 +78,14 @@ class IPCProcess : public Object
 
     public:
 
-        IPCProcess(Context* context, int fd1, int fd2, int pid = -1);
+    IPCProcess(Context* context, int fd1, int fd2, int pid = -1);
 
     virtual ~IPCProcess();
 
     bool IsRunning();
 
+    bool Terminate() { return true; }
+
     int fd1() const { return fd1_; }
     int fd2() const { return fd2_; }
 

+ 11 - 0
Source/Atomic/IPC/IPCWindows.cpp

@@ -263,6 +263,17 @@ IPCProcess::~IPCProcess()
 
 }
 
+bool IPCProcess::Terminate()
+{
+    if (TerminateProcess(pid_, 0))
+    {
+        WaitForSingleObject(pid_, 1000);
+        return true;
+    }
+        
+    return false;
+}
+
 bool IPCProcess::IsRunning()
 {
     DWORD exitCode;

+ 3 - 1
Source/Atomic/IPC/IPCWindows.h

@@ -115,12 +115,14 @@ class IPCProcess : public Object
 
     public:
 
-        IPCProcess(Context* context, IPCHandle clientRead, IPCHandle clientWrite, IPCHandle pid = INVALID_IPCHANDLE_VALUE);
+    IPCProcess(Context* context, IPCHandle clientRead, IPCHandle clientWrite, IPCHandle pid = INVALID_IPCHANDLE_VALUE);
 
     virtual ~IPCProcess();
 
     bool IsRunning();
 
+    bool Terminate();
+
     IPCHandle clientRead() const { return clientRead_; }
     IPCHandle clientWrite() const { return clientWrite_; }