Revert "ELECTRON-758 - Change network request implementation to use electron's API (#509)" (#514)

This reverts commit 0c8b322
This commit is contained in:
Kiran Niranjan
2018-10-03 21:30:52 +05:30
committed by Vishwas Shashidhar
parent 4e25fddbe6
commit c895291324
4 changed files with 25 additions and 48 deletions

View File

@@ -366,6 +366,18 @@ function createAPI() {
throttledSetLocale(locale);
}
},
/**
* Allows JS to register activeRequests that can be used by electron to
* get the active network request from the client
*
* @param activeRequests
*/
registerActiveRequests: function (activeRequests) {
if (typeof activeRequests === 'function') {
local.activeRequests = activeRequests;
}
},
};
// add support for both ssf and SYM_API name-space.
@@ -518,10 +530,12 @@ function createAPI() {
if (window.name === 'main') {
const memory = process.getProcessMemoryInfo();
const cpuUsage = process.getCPUUsage();
const activeRequests = local.activeRequests();
local.ipcRenderer.send(apiName, {
cmd: apiCmds.optimizeMemoryConsumption,
memory,
cpuUsage,
activeRequests,
});
}
});