Move createIDWeakMap to v8Util

This commit is contained in:
Cheng Zhao
2016-05-11 19:30:06 +09:00
parent a077355d70
commit 49ac160ff7
6 changed files with 4 additions and 27 deletions

View File

@@ -3,7 +3,6 @@
const electron = require('electron')
const v8Util = process.atomBinding('v8_util')
const {ipcMain} = electron
const {createIDWeakMap} = process.atomBinding('id_weak_map')
const objectsRegistry = require('./objects-registry')
@@ -14,7 +13,7 @@ const FUNCTION_PROPERTIES = [
// The remote functions in renderer processes.
// id => Function
let rendererFunctions = createIDWeakMap()
let rendererFunctions = v8Util.createIDWeakMap()
// Merge two IDs together.
let mergeIds = function (webContentsId, metaId) {

View File

@@ -2,13 +2,12 @@
const v8Util = process.atomBinding('v8_util')
const {ipcRenderer, CallbacksRegistry} = require('electron')
const {createIDWeakMap} = process.atomBinding('id_weak_map')
const callbacksRegistry = new CallbacksRegistry()
var includes = [].includes
var remoteObjectCache = createIDWeakMap()
var remoteObjectCache = v8Util.createIDWeakMap()
// Check for circular reference.
var isCircular = function (field, visited) {