refactor: prevent consistent early exception (#24191)

* refactor: prevent consistent early exception

* Use _linkedBinding where possible

* Remove dead electronBinding
This commit is contained in:
Shelley Vohr 2020-06-22 20:32:45 -07:00 committed by GitHub
commit 659e79fc08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 134 additions and 145 deletions

View file

@ -2,7 +2,13 @@ import * as url from 'url';
import { Readable, Writable } from 'stream';
import { app } from 'electron';
import { ClientRequestConstructorOptions, UploadProgress } from 'electron/main';
const { net, Net, isValidHeaderName, isValidHeaderValue, createURLLoader } = process.electronBinding('net');
const {
net,
Net,
isValidHeaderName,
isValidHeaderValue,
createURLLoader
} = process._linkedBinding('electron_browser_net');
const kSupportedProtocols = new Set(['http:', 'https:']);