Description[Oilpan] De-oilpanize ScopedPageLoadDeferrer.
ScopedPageLoadDeferrer is an RAII-like class that does some work when it is
constructed and destructed, just like other ScopedXXX classes.
It was oilpanized in the past, and a new method, dispose(), was added to
do clean-ups that had been done in the destructor. However, a few stack-
allocated usages were overlooked in that change.
Garbage-collected objects shouldn't be allocated on the stack. So, stack-
allocated usages should be converted to heap-allocated, with dispose() calls
added in every single place where the object can go out of scope.
However, I find this conversion too cumbersome and less C++-idiomatic.
Therefore, this patch instead de-oilpanizes ScopedPageLoadDeferrer. The only
reference to will-be-heap-managed class in ScopedPageLoadDeferrer is
RefPtr<LocalFrame>, so it is safe to convert it to RefPtrWillBePersistent.
I think this patch makes the code cleaner overall.
BUG=486590
R=haraken@chromium.org, oilpan-reviews@chromium.org, sigbjornf@opera.com
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201630
Patch Set 1 #
Messages
Total messages: 9 (3 generated)
|