fix: use context counter as contextId

For sandboxed renderer it may not have a node::Environment in the context,
using a increasing counter as contextId works for all cases.
This commit is contained in:
Cheng Zhao 2018-07-19 13:29:47 +09:00 committed by Jeremy Apthorp
parent 9acfe34286
commit e2029435c4
10 changed files with 67 additions and 24 deletions

View file

@ -10,7 +10,7 @@ const callbacksRegistry = new CallbacksRegistry()
const remoteObjectCache = v8Util.createIDWeakMap()
// An unique ID that can represent current context.
const contextId = v8Util.getContextId()
const contextId = v8Util.getHiddenValue(global, 'contextId')
// Notify the main process when current context is going to be released.
// Note that when the renderer process is destroyed, the message may not be