Only document deprecation for now

This commit is contained in:
Kevin Sawicki 2017-02-07 15:44:56 -08:00
parent 9c134e7bf3
commit 5245d42d15
2 changed files with 16 additions and 9 deletions

View file

@ -91,6 +91,19 @@ process.versions.electron
read-only properties for consistency with the other `process.versions` read-only properties for consistency with the other `process.versions`
properties set by Node. properties set by Node.
## `session`
```js
// Deprecated
ses.setCertificateVerifyProc(function (hostname, certificate, callback) {
callback(true)
})
// Replace with
ses.setCertificateVerifyProc(function (hostname, certificate, error, callback) {
callback(0)
})
```
## `Tray` ## `Tray`
```js ```js

View file

@ -1,5 +1,5 @@
const {EventEmitter} = require('events') const {EventEmitter} = require('events')
const {app, deprecate} = require('electron') const {app} = require('electron')
const {fromPartition, Session, Cookies} = process.atomBinding('session') const {fromPartition, Session, Cookies} = process.atomBinding('session')
// Public API. // Public API.
@ -21,15 +21,9 @@ Session.prototype._init = function () {
app.emit('session-created', this) app.emit('session-created', this)
} }
// Remove after 2.0
Session.prototype.setCertificateVerifyProc = function (verifyProc) { Session.prototype.setCertificateVerifyProc = function (verifyProc) {
if (!verifyProc) { if (verifyProc != null && verifyProc.length <= 3) {
this._setCertificateVerifyProc(null) // TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
return
}
if (verifyProc.length <= 3) {
deprecate.warn('setCertificateVerifyproc(hostname, certificate, callback)',
'setCertificateVerifyproc(hostname, certificate, error, callback)')
this._setCertificateVerifyProc((hostname, certificate, error, cb) => { this._setCertificateVerifyProc((hostname, certificate, error, cb) => {
verifyProc(hostname, certificate, (result) => { verifyProc(hostname, certificate, (result) => {
cb(result ? 0 : -2) cb(result ? 0 : -2)