Chromium Code Reviews| Index: Source/core/dom/Range.h |
| diff --git a/Source/core/dom/Range.h b/Source/core/dom/Range.h |
| index bb0f769176188a0d54de33ed3dabf43b39608e5b..c31de516a43ba7712242b37cbb1a2488ab57df53 100644 |
| --- a/Source/core/dom/Range.h |
| +++ b/Source/core/dom/Range.h |
| @@ -170,6 +170,32 @@ private: |
| RangeBoundaryPoint m_end; |
| }; |
| +#if ENABLE(OILPAN) |
| +// Ranges are registered on the owner document so that they can be |
| +// updated via the document when the document changes. Ranges are |
| +// often used as short-lived results of subcomputations that become |
| +// unreachable without any document modifications. Such short-lived |
| +// ranges need not be registered with the document. When a |
| +// TempRangeScope is on the stack created range objects are not |
| +// attached to the document. With Oilpan this is important to not |
| +// build up a large set of ranges on the Document that we will waste |
| +// time updating even though they will never be needed. |
| +class TempRangeScope { |
|
haraken
2014/06/24 11:57:16
TempRangeScope => TemporaryRangeScope
Blink prefe
Mads Ager (chromium)
2014/06/24 12:16:51
Done.
|
| +public: |
| + TempRangeScope() { ++s_nesting; } |
| + ~TempRangeScope() { --s_nesting; } |
| + static bool active() { return s_nesting != 0; } |
| +private: |
| + static unsigned s_nesting; |
| +}; |
| +#else |
| +class TempRangeScope { |
| +public: |
| + TempRangeScope() { } |
| + static bool active() { return false; } |
| +}; |
| +#endif |
| + |
| PassRefPtrWillBeRawPtr<Range> rangeOfContents(Node*); |
| bool areRangesEqual(const Range*, const Range*); |