[EFL] Do not consider test directories when DEVELOPER_MODE is OFF
authorryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Jun 2015 09:18:43 +0000 (09:18 +0000)
committerryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Jun 2015 09:18:43 +0000 (09:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146171

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsEfl.cmake:
Exposed ENABLE_DEVELOPER_MODE to Compiler and CMake definition when DEVELOPER_MODE is ON.

Source/WebCore:

* platform/efl/EflInspectorUtilities.cpp:
(WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.

Source/WebKit2:

* PlatformEfl.cmake:
Do not define SOURCE_DIR when DEVELOPER_MODE is OFF for seccomp filter
not to allow jhbuild directory.
* Shared/efl/ProcessExecutablePathEfl.cpp:
(WebKit::findProcessPath): Guard test code to ENABLE(DEVELOPER_MODE).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185790 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/efl/EflInspectorUtilities.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp
Source/cmake/OptionsEfl.cmake

index 2125418..fac0c29 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
+
+        [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
+        https://bugs.webkit.org/show_bug.cgi?id=146171
+
+        Reviewed by Gyuyoung Kim.
+
+        * Source/cmake/OptionsEfl.cmake:
+        Exposed ENABLE_DEVELOPER_MODE to Compiler and CMake definition when DEVELOPER_MODE is ON.
+
 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [CMake] FindGTK3.cmake should not modify the values of build options
index 607065c..f342429 100644 (file)
@@ -1,3 +1,13 @@
+2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
+
+        [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
+        https://bugs.webkit.org/show_bug.cgi?id=146171
+
+        Reviewed by Gyuyoung Kim.
+
+        * platform/efl/EflInspectorUtilities.cpp:
+        (WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.
+
 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Fix absolute value warning in LocalizedStringsGtk.cpp
index 1994935..4bc51ee 100644 (file)
 #include "config.h"
 #include "EflInspectorUtilities.h"
 
-#include <unistd.h>
-#include <wtf/text/CString.h>
-
 namespace WebCore {
 
 String inspectorResourcePath()
 {
-    String inspectorResourcePath = String::fromUTF8(WEB_INSPECTOR_INSTALL_DIR);
-    if (access(inspectorResourcePath.utf8().data(), R_OK))
-        inspectorResourcePath = WEB_INSPECTOR_DIR;
-
-    return inspectorResourcePath;
+    return String::fromUTF8(WEB_INSPECTOR_DIR);
 }
 
 } // namespace WebCore
index 8ed3c32..97c5b0d 100644 (file)
@@ -1,3 +1,16 @@
+2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
+
+        [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
+        https://bugs.webkit.org/show_bug.cgi?id=146171
+
+        Reviewed by Gyuyoung Kim.
+
+        * PlatformEfl.cmake:
+        Do not define SOURCE_DIR when DEVELOPER_MODE is OFF for seccomp filter
+        not to allow jhbuild directory.
+        * Shared/efl/ProcessExecutablePathEfl.cpp:
+        (WebKit::findProcessPath): Guard test code to ENABLE(DEVELOPER_MODE).
+
 2015-06-18  Myles C. Maxfield  <mmaxfield@apple.com>
 
         REGRESSION(r185475): [Mac] ASSERT() when clicking on text using web fonts with force touch trackpad
index 389491c..9c1cd81 100644 (file)
@@ -336,7 +336,7 @@ if (ENABLE_SECCOMP_FILTERS)
 
     # If building with jhbuild, add the root build directory to the
     # filesystem access policy.
-    if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/WebKitBuild/DependenciesEFL)
+    if (DEVELOPER_MODE AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/WebKitBuild/DependenciesEFL)
         add_definitions(-DSOURCE_DIR=\"${CMAKE_SOURCE_DIR}\")
     endif ()
 endif ()
index 4d999d6..5c1819f 100644 (file)
@@ -39,6 +39,7 @@ namespace WebKit {
 // directory of the running process, and finally we try LIBEXECDIR (usually /usr/local/bin).
 static String findProcessPath(const char* processName)
 {
+#if ENABLE(DEVELOPER_MODE)
     String executablePath;
     static const char* execDirectory = getenv("WEBKIT_EXEC_PATH");
     if (execDirectory) {
@@ -62,9 +63,8 @@ static String findProcessPath(const char* processName)
             return executablePath;
     }
 #endif
-    executablePath = WebCore::pathByAppendingComponent(String(LIBEXECDIR), processName);
-    ASSERT(WebCore::fileExists(executablePath));
-    return executablePath;
+#endif
+    return WebCore::pathByAppendingComponent(String::fromUTF8(LIBEXECDIR), processName);
 }
 
 String executablePathOfWebProcess()
index 1a1896a..73364e9 100644 (file)
@@ -39,8 +39,6 @@ add_definitions(-DBUILDING_EFL__=1)
 add_definitions(-DUSE_CROSS_PLATFORM_CONTEXT_MENUS=1)
 add_definitions(-DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}"
                 -DDEFAULT_THEME_DIR="${THEME_BINARY_DIR}")
-add_definitions(-DWEB_INSPECTOR_DIR=\"${CMAKE_BINARY_DIR}/${WEB_INSPECTOR_DIR}\")
-add_definitions(-DWEB_INSPECTOR_INSTALL_DIR=\"${CMAKE_INSTALL_PREFIX}/${WEB_INSPECTOR_DIR}\")
 
 # EWebKit2 tests need a hint to find out where processes such as WebProcess are located at.
 add_definitions(-DWEBKIT_EXEC_PATH=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\")
@@ -49,12 +47,19 @@ file(MAKE_DIRECTORY ${THEME_BINARY_DIR})
 
 WEBKIT_OPTION_BEGIN()
 
+SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})
 if (DEVELOPER_MODE)
     set(ENABLE_TOOLS ON)
+
+    add_definitions(-DWEB_INSPECTOR_DIR=\"${CMAKE_BINARY_DIR}/${WEB_INSPECTOR_DIR}\")
+
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PUBLIC ON)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MINIBROWSER PUBLIC ON)
 else ()
     set(ENABLE_TOOLS OFF)
+
+    add_definitions(-DWEB_INSPECTOR_DIR=\"${CMAKE_INSTALL_PREFIX}/${WEB_INSPECTOR_DIR}\")
+
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PUBLIC OFF)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MINIBROWSER PUBLIC OFF)
     set(WebKit2_VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/eflsymbols.filter")