Use phantom handles instead of weak handles
authorJochen Eisinger <jochen@chromium.org>
Thu, 14 May 2015 00:00:44 +0000 (02:00 +0200)
committerJochen Eisinger <jochen@chromium.org>
Thu, 14 May 2015 00:00:44 +0000 (02:00 +0200)
commit1b8a296b5d1fdd7f6d7daa099f7feef869e05e5e
treeb5abbe51992f6925bc9c3978d5444910e516c2ba
parent8aa1eac606d8e5030de6509f5d5d66e90db521f4
Use phantom handles instead of weak handles

Phantom handles allow for freeing objects with one pass of GC. However,
this means that by the time the callback is invoked, the v8 object already
does no longer exist. To avoid accidential access to the dead object, there
are now two callbacks, where the first must only reset the handle, and the
second does the clean-up work.

R=tsepez@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1129253004
fpdfsdk/include/javascript/JS_Object.h
fpdfsdk/include/jsapi/fxjs_v8.h
fpdfsdk/src/javascript/JS_Object.cpp
fpdfsdk/src/jsapi/fxjs_v8.cpp