Introduce Range::dispose() for prompt detachment from owner Document.

With Oilpan, Range objects become detached from their Document once GC
determines that the Range object is no longer referred to and can be
swept out, along with clearing out the object from the Document's weak
map. If GCs aren't otherwise being triggered regularly, this can in
some cases lead to unnecessary buildup of weakly held, but effectively
dead objects in that Document map. Something which slows down GC once
it eventually strikes.

To address, we introduce a dispose() method over Range so as to let code
handle the cases where it is known that the Range object is no longer
referenced & used and can be promptly detached from its Document. Less
GC overhead being the (desired) result.

R=yosin,haraken
BUG=388681

Review URL: https://codereview.chromium.org/1335573004

git-svn-id: svn://svn.chromium.org/blink/trunk@202138 bbb929c8-8fbe-4397-9dbb-9b2b20218538
4 files changed
tree: f03e73d19532177bb9112790d00db520a383e207
  1. third_party/