Dereference remote objects with native code
authorCheng Zhao <zcbenz@gmail.com>
Tue, 26 Apr 2016 07:10:27 +0000 (16:10 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 26 Apr 2016 07:16:22 +0000 (16:16 +0900)
commit06cf0406fe8ddcef3a500a689952c77fdfb9c9a8
tree308794429784b9c0737746ddf856a3522ad9b596
parent570dc7ca9bc3a69b9018a01ec46b9e541d76ea56
Dereference remote objects with native code

Previously we rely on the v8util.setDestructor to dereference the remote
objects in JavaScript, however as documented in V8, it is forbidden to
call V8 APIs in object's destructor (e.g. the weak callback), and doing
so would result in crashs.

This commit removes the JavaScript setDestructor method, and avoids
doing the dereference work with V8.
12 files changed:
atom/common/api/atom_api_v8_util.cc
atom/common/api/object_life_monitor.cc
atom/common/api/object_life_monitor.h
atom/common/api/remote_callback_freer.cc [new file with mode: 0644]
atom/common/api/remote_callback_freer.h [new file with mode: 0644]
atom/common/api/remote_object_freer.cc [new file with mode: 0644]
atom/common/api/remote_object_freer.h [new file with mode: 0644]
atom/common/native_mate_converters/content_converter.cc
atom/common/native_mate_converters/content_converter.h
filenames.gypi
lib/browser/rpc-server.js
lib/renderer/api/remote.js