IndexedDB: Have IDBCursor and IDBRequest explicitly break ref cycles
Until (1) a transaction ends or (2) a cursor hits the end of its range, an IDBRequest holds on to an IDBCursor as its result. Per spec, calling continue() or advance() on the cursor re-uses the same IDBRequest, requiring a reference cycle. Previously, the cycle was broken explicitly on either of those two conditions, but until that time a cursor-request pair would "leak", holding on to potentially large script value results. This patch makes both classes RefCountedBase::deref() and check to see if they have a partner object and both refcounts are 1. If so, the cycle is broken. Special case cruft for condition #1 is removed to simplify the code - just rely on GC to reclaim the objects if necessary. R=alecflett@chromium.org,dgrogan@chromium.org BUG=225860 Review URL: https://chromiumcodereview.appspot.com/23653024 git-svn-id: svn://svn.chromium.org/blink/trunk@157382 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment