Introduce Range::dispose() for prompt detachment from owner Document.
commit3f33a00c8c0ab1c8b652387886a3ff34bc514a30
authorsigbjornf@opera.com <sigbjornf@opera.com>
Fri, 11 Sep 2015 15:10:23 +0000 (11 15:10 +0000)
committersigbjornf@opera.com <sigbjornf@opera.com>
Fri, 11 Sep 2015 15:10:23 +0000 (11 15:10 +0000)
tree42f29f283bf9267b9b076c2aa5b88457f329047a
parente521b6458a5c2f2fe081fd5a2516af77e462e50e
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
third_party/WebKit/Source/core/dom/Range.cpp
third_party/WebKit/Source/core/dom/Range.h
third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h