From 84c93d2f9edfcf428d46377fe38dc4638ee88bd9 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Fri, 31 Jan 2020 17:07:15 -0800 Subject: [PATCH] browser(webkit): plumb stderr from the web process to the main process (#792) This allows `fprintf(stderr, "my message\n")` and `WTFReportBacktrace()` to work from the web process in Windows! https://github.com/JoelEinbinder/webkit/commit/ea530a62b9cdd25135f499600b441fd528f8013e --- browser_patches/webkit/BUILD_NUMBER | 2 +- browser_patches/webkit/patches/bootstrap.diff | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER index 5e8d8532ec..7fdcfb8c04 100644 --- a/browser_patches/webkit/BUILD_NUMBER +++ b/browser_patches/webkit/BUILD_NUMBER @@ -1 +1 @@ -1130 +1131 diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index 6ce7b7a5b8..fa744dd92f 100644 --- a/browser_patches/webkit/patches/bootstrap.diff +++ b/browser_patches/webkit/patches/bootstrap.diff @@ -8237,6 +8237,23 @@ index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b2 +}; + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp +index 8a871bf2916d5eab86becf5fde0faed79283d88c..a19a429c4d53edf81c3028c7053265e6c22c171a 100644 +--- a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp ++++ b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp +@@ -92,8 +92,11 @@ void ProcessLauncher::launchProcess() + + STARTUPINFO startupInfo { }; + startupInfo.cb = sizeof(startupInfo); +- startupInfo.dwFlags = STARTF_USESHOWWINDOW; ++ startupInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; + startupInfo.wShowWindow = SW_HIDE; ++ startupInfo.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE); ++ startupInfo.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE); ++ startupInfo.hStdError = ::GetStdHandle(STD_ERROR_HANDLE); + PROCESS_INFORMATION processInformation { }; + BOOL result = ::CreateProcess(0, commandLine.data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation); + diff --git a/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp b/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b4ec2de5671723f4045e98b3e398fc11180b3b8