[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 Review URL: https://codereview.chromium.org/1316663004 git-svn-id: svn://svn.chromium.org/blink/trunk@201630 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment