From 21d2239723843f738de8649b0cc43bd5ce77c254 Mon Sep 17 00:00:00 2001 From: Georg Koppen Date: Wed, 13 Dec 2017 14:15:57 +0000 Subject: [PATCH] Bug 24398: Plugin-container process exhausts memory The plugin-container process can thrash/crash due to increasing memory consumption after our workaround for bug 24052. The patch provided by a cypherpunk (big thanks!) deals with that as far as the Developer Tools are concerned. --- devtools/shared/DevToolsUtils.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/devtools/shared/DevToolsUtils.js b/devtools/shared/DevToolsUtils.js index 8994956f48501..12419f9ec1e32 100644 --- a/devtools/shared/DevToolsUtils.js +++ b/devtools/shared/DevToolsUtils.js @@ -697,11 +697,16 @@ function newChannelForURL(url, { policy, window, principal }) { try { return NetUtil.newChannel(channelOptions); } catch (e) { - // In xpcshell tests on Windows, nsExternalProtocolHandler::NewChannel() - // can throw NS_ERROR_UNKNOWN_PROTOCOL if the external protocol isn't - // supported by Windows, so we also need to handle the exception here if - // parsing the URL above doesn't throw. - return newChannelForURL("file://" + url, { policy, window, principal }); + if (e.name === "NS_ERROR_UNKNOWN_PROTOCOL" && + !(url.startsWith("file://"))) { + // In xpcshell tests on Windows, nsExternalProtocolHandler::NewChannel() + // can throw NS_ERROR_UNKNOWN_PROTOCOL if the external protocol isn't + // supported by Windows, so we also need to handle the exception here if + // parsing the URL above doesn't throw. + return newChannelForURL("file://" + url, { policy, window, principal }); + } + + throw e; } } -- GitLab