Bug 61352 - Refactor RenderView::{enable,disable}LayoutState call sites to use RIIA
Summary: Refactor RenderView::{enable,disable}LayoutState call sites to use RIIA
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yuzo Fujishima
URL:
Keywords:
Depends on:
Blocks: 47815
  Show dependency treegraph
 
Reported: 2011-05-24 02:42 PDT by Yuzo Fujishima
Modified: 2011-05-25 00:17 PDT (History)
1 user (show)

See Also:


Attachments
Patch (14.97 KB, patch)
2011-05-24 03:24 PDT, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
Addressed nit (14.92 KB, patch)
2011-05-24 20:33 PDT, Yuzo Fujishima
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuzo Fujishima 2011-05-24 02:42:17 PDT
The following pattern appears 10 times or so in the codebase.

view->disableLayoutState();
...
view->enableLayoutState();


It should be replaced with RIIA, that is:

{
    LayoutStateDisabler layoutStateDisabler(view);
    ...
}
Comment 1 Yuzo Fujishima 2011-05-24 03:24:07 PDT
Created attachment 94588 [details]
Patch
Comment 2 Kent Tamura 2011-05-24 17:28:31 PDT
Comment on attachment 94588 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94588&action=review

looks good.

> Source/WebCore/page/FrameView.cpp:987
> +        if (subtree) {
> +            RenderView* view = root->view();
> +            view->popLayoutState(root);
> +        }

nit: The variable 'view' is not needed.

if (subtree)
    root->view()->popLayoutState(root);
Comment 3 Yuzo Fujishima 2011-05-24 20:33:14 PDT
Created attachment 94733 [details]
Addressed nit
Comment 4 WebKit Commit Bot 2011-05-25 00:17:34 PDT
Comment on attachment 94733 [details]
Addressed nit

Clearing flags on attachment: 94733

Committed r87277: <http://trac.webkit.org/changeset/87277>
Comment 5 WebKit Commit Bot 2011-05-25 00:17:39 PDT
All reviewed patches have been landed.  Closing bug.