Hide in_memory parameter in native interface
This commit is contained in:
parent
06a41cedab
commit
400bb8d0f3
4 changed files with 30 additions and 34 deletions
|
@ -2,24 +2,15 @@ const {EventEmitter} = require('events')
|
|||
const {app} = require('electron')
|
||||
const {fromPartition, _setWrapSession} = process.atomBinding('session')
|
||||
|
||||
const PERSIST_PREFIX = 'persist:'
|
||||
|
||||
// Returns the Session from |partition| string.
|
||||
exports.fromPartition = function (partition = '') {
|
||||
if (partition === '') return exports.defaultSession
|
||||
|
||||
if (partition.startsWith(PERSIST_PREFIX)) {
|
||||
return fromPartition(partition.substr(PERSIST_PREFIX.length), false)
|
||||
} else {
|
||||
return fromPartition(partition, true)
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the default session.
|
||||
Object.defineProperty(exports, 'defaultSession', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return fromPartition('', false)
|
||||
Object.defineProperties(exports, {
|
||||
defaultSession: {
|
||||
enumerable: true,
|
||||
get () { return fromPartition('') }
|
||||
},
|
||||
fromPartition: {
|
||||
enumerable: true,
|
||||
value: fromPartition
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue