[Title] Support the method to set WebProcess executable path that is forked/executed by UIProcess.
[Issue#] DCM-2299
[Problem] Some tizen device api based on tizen 'appid' doesn't work in WebProcess.
[Cause] Tizen Webkit considers only web app process model, that has 1UIProcess and 1WebProcess.
But, web-provider for dynamic box, has 1UIProcess and NWebProcess.
And the N WebProcesses must has different /proc/self/cmdline from each other,
because some tizen device api uses 'appid' using app_manager API, which reads /proc/self/cmdline of the WebProcess internally.
Currently, forked all WebProcesses has '/usr/bin/WebProcess' as /proc/self/cmdline value.
This is cause of this issue.
[Solution] For fixing this issue, special method to set WebProcess path per ewk context is added using env variable.
ewk_context_new() or ewk_context_new_with_injected_bundle() reads this env variable as soon as ewk context is created.
web-provider will change value of the env variable to proper path before calling ewk_context_new_with_injected_bundle().
For using this webkit's support, web-provider may create several symbolic links to /usr/bin/WebProcess.
Change-Id: I9ea320774ce32b5e88bf74450b53b9d66628fa1b
#define ENABLE_TIZEN_UPDATE_TIMEZONE_INFO 1 /* Hojong Han(hojong.han@samsung.com) : Sync timezone before getting local time */
#define ENABLE_TIZEN_WRT_LAUNCHING_PERFORMANCE 1 /* Byungwoo Lee(bw80.lee@samsung.com) : Local patches to enhance web app launching performance */
+#define ENABLE_TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH 1 /* Yunchan Cho(yunchan.cho@samsung.com) : Support to set path of web process executable file */
#define ENABLE_TIZEN_REDUCE_KEY_LAGGING 1 /* Soon-Young Lee(sy5002.lee@samsung.com) : Temporary solution for a keylagging problem. FIXME */
#define ENABLE_TIZEN_TEXT_CODEC_MEMORY_REDUCTION 1 /*KyungTae Kim(ktf.kim@samsung.com) : Share Encode & Decode buffer for TextCodecUTF8 for memory reduction */
Ewk_Context* ewk_context_new()
{
#if OS(TIZEN)
- Ewk_Context* ewk_context = Ewk_Context::create().leakRef();
- ewkContextInjectedBundleClientAttachClient(ewk_context);
- return ewk_context;
+ Ewk_Context* ewkContext = Ewk_Context::create().leakRef();
+ ewkContextInjectedBundleClientAttachClient(ewkContext);
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH");
+ if (webProcessExecutablePath) {
+ WKContextRef contextRef = ewkContext->wkContext();
+ toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath));
+ }
#endif
+ return ewkContext;
+#else
return Ewk_Context::create().leakRef();
+#endif
}
Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
#endif
#if OS(TIZEN)
- Ewk_Context* ewk_context = Ewk_Context::create(String::fromUTF8(path)).leakRef();
- ewkContextInjectedBundleClientAttachClient(ewk_context);
- return ewk_context;
+ Ewk_Context* ewkContext = Ewk_Context::create(String::fromUTF8(path)).leakRef();
+ ewkContextInjectedBundleClientAttachClient(ewkContext);
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH");
+ if (webProcessExecutablePath) {
+ WKContextRef contextRef = ewkContext->wkContext();
+ toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath));
+ }
#endif
+ return ewkContext;
+#else
return Ewk_Context::create(String::fromUTF8(path)).leakRef();
+#endif
}
void ewk_context_delete(Ewk_Context* ewkContext)
cpu_type_t architecture;
bool executableHeap;
#endif
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ String webProcessExecutablePath;
+#endif
#ifndef NDEBUG
String processCmdPrefix;
#endif
String executablePath;
switch (m_launchOptions.processType) {
case WebProcess:
- executablePath = executablePathOfWebProcess();
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ if (!m_launchOptions.webProcessExecutablePath.isEmpty()) {
+ executablePath = m_launchOptions.webProcessExecutablePath;
+ TIZEN_LOGI("executable path: %s", executablePath.utf8().data());
+ } else
+#endif
+ executablePath = executablePathOfWebProcess();
break;
case PluginProcess:
executablePath = executablePathOfPluginProcess();
#endif
, m_processTerminationEnabled(true)
, m_pluginWorkQueue("com.apple.CoreIPC.PluginQueue")
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ , m_webProcessExecutablePath(String())
+#endif
{
#if !LOG_DISABLED
WebKit::initializeLogChannelsIfNecessary();
#if PLATFORM(EFL)
void notifyLowMemory();
#endif
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ void setWebProcessExecutablePath(const String);
+ const String& webProcessExecutablePath() const { return m_webProcessExecutablePath; };
+#endif
#if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
void setMemorySavingMode(bool memorySavingMode);
#endif
String m_soupDataDirectory;
#endif
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ String m_webProcessExecutablePath;
+#endif
+
bool m_processTerminationEnabled;
HashMap<uint64_t, RefPtr<DictionaryCallback> > m_dictionaryCallbacks;
launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
launchOptions.executableHeap = false;
#endif
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+ launchOptions.webProcessExecutablePath = m_context->webProcessExecutablePath();
+#endif
+
#ifndef NDEBUG
const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX");
if (webProcessCmdPrefix && *webProcessCmdPrefix)
}
#endif
+#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
+void WebContext::setWebProcessExecutablePath(const String webProcessExecutablePath)
+{
+ m_webProcessExecutablePath = webProcessExecutablePath;
+}
+#endif
+
#if ENABLE(TIZEN_SESSION_REQUEST_CANCEL)
void WebContext::abortSession()
{