diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-09-04 20:53:31 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-09-04 20:53:31 +0200 |
commit | 580084e9e1d0355c96a54a9641df6c1fee894948 (patch) | |
tree | 5aff416b5aed2ca9e326054567d837f28c20ed25 /ipc | |
parent | fc61780b35af913801d72086456f493f63197da6 (diff) | |
parent | b28ab55f9675f2e97dda9a4fcac0d4f5267a2bb9 (diff) | |
download | UXP-2018.09.05.tar UXP-2018.09.05.tar.gz UXP-2018.09.05.tar.lz UXP-2018.09.05.tar.xz UXP-2018.09.05.zip |
Merge branch 'master' into Basilisk-releasev2018.09.05
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/chromium/src/base/process_util_win.cc | 27 | ||||
-rw-r--r-- | ipc/glue/GeckoChildProcessHost.cpp | 3 | ||||
-rw-r--r-- | ipc/glue/MessageChannel.cpp | 15 |
3 files changed, 27 insertions, 18 deletions
diff --git a/ipc/chromium/src/base/process_util_win.cc b/ipc/chromium/src/base/process_util_win.cc index f22f7216f..fa9b86ace 100644 --- a/ipc/chromium/src/base/process_util_win.cc +++ b/ipc/chromium/src/base/process_util_win.cc @@ -298,6 +298,33 @@ bool LaunchApp(const std::wstring& cmdline, LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList = NULL; + // setup our handle array first - if we end up with no handles that can + // be inherited we can avoid trying to do the ThreadAttributeList dance... + HANDLE handlesToInherit[2]; + int handleCount = 0; + HANDLE stdOut = ::GetStdHandle(STD_OUTPUT_HANDLE); + HANDLE stdErr = ::GetStdHandle(STD_ERROR_HANDLE); + + if (IsInheritableHandle(stdOut)) + handlesToInherit[handleCount++] = stdOut; + if (stdErr != stdOut && IsInheritableHandle(stdErr)) + handlesToInherit[handleCount++] = stdErr; + + if (handleCount) { + lpAttributeList = CreateThreadAttributeList(handlesToInherit, handleCount); + if (lpAttributeList) { + // it's safe to inherit handles, so arrange for that... + startup_info.cb = sizeof(startup_info_ex); + startup_info.dwFlags |= STARTF_USESTDHANDLES; + startup_info.hStdOutput = stdOut; + startup_info.hStdError = stdErr; + startup_info.hStdInput = INVALID_HANDLE_VALUE; + startup_info_ex.lpAttributeList = lpAttributeList; + dwCreationFlags |= EXTENDED_STARTUPINFO_PRESENT; + bInheritHandles = TRUE; + } + } + PROCESS_INFORMATION process_info; BOOL createdOK = CreateProcess(NULL, const_cast<wchar_t*>(cmdline.c_str()), NULL, NULL, diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index e58408e0c..8147e87dc 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -32,7 +32,6 @@ #include "mozilla/ClearOnShutdown.h" #include "mozilla/ipc/BrowserProcessSubThread.h" #include "mozilla/Omnijar.h" -#include "mozilla/Telemetry.h" #include "ProtocolUtils.h" #include <sys/stat.h> @@ -534,8 +533,6 @@ GeckoChildProcessHost::RunPerformAsyncLaunch(std::vector<std::string> aExtraOpts lock.Notify(); CHROMIUM_LOG(ERROR) << "Failed to launch " << XRE_ChildProcessTypeToString(mProcessType) << " subprocess"; - Telemetry::Accumulate(Telemetry::SUBPROCESS_LAUNCH_FAILURE, - nsDependentCString(XRE_ChildProcessTypeToString(mProcessType))); } return ok; } diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index 7861f3e2d..a988fae53 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -760,11 +760,6 @@ MessageChannel::Echo(Message* aMsg) bool MessageChannel::Send(Message* aMsg) { - if (aMsg->size() >= kMinTelemetryMessageSize) { - Telemetry::Accumulate(Telemetry::IPC_MESSAGE_SIZE, - nsDependentCString(aMsg->name()), aMsg->size()); - } - MOZ_RELEASE_ASSERT(!aMsg->is_sync()); MOZ_RELEASE_ASSERT(aMsg->nested_level() != IPC::Message::NESTED_INSIDE_SYNC); @@ -1059,11 +1054,6 @@ MessageChannel::ProcessPendingRequests(AutoEnterTransaction& aTransaction) bool MessageChannel::Send(Message* aMsg, Message* aReply) { - if (aMsg->size() >= kMinTelemetryMessageSize) { - Telemetry::Accumulate(Telemetry::IPC_MESSAGE_SIZE, - nsDependentCString(aMsg->name()), aMsg->size()); - } - nsAutoPtr<Message> msg(aMsg); // Sanity checks. @@ -1249,10 +1239,6 @@ MessageChannel::Send(Message* aMsg, Message* aReply) MOZ_RELEASE_ASSERT(reply->is_sync()); *aReply = Move(*reply); - if (aReply->size() >= kMinTelemetryMessageSize) { - Telemetry::Accumulate(Telemetry::IPC_REPLY_SIZE, - nsDependentCString(msgName), aReply->size()); - } return true; } @@ -2546,7 +2532,6 @@ void CancelCPOWs() { if (gParentProcessBlocker) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_TRANSACTION_CANCEL, true); gParentProcessBlocker->CancelCurrentTransaction(); } } |