[WebLayer] PageInfo no longer uses ui in its constructor.
Several classes inherit from PageInfoUI and create a PageInfo object, which needs a pointer to a PageInfoUI object in turn to be constructed. This CL removes all usage of PageInfoUI from PageInfo's constructor by adding a SetUiAndInit method on PageInfo. This eliminates a potential source of crashes wherein PageInfo calls into PageInfoUI (concretely, the PageInfoUI subclass) from its constructor, the latter tries to access its PageInfo member, and that member is null precisely because it is in the process of being set. There is no behavioral change, as all creation sites of PageInfo now call its InitializeUIState() method immediately after constructing it. One detail: Prior to this change, |security_level_| wasn't set in the PageInfo constructor's initialization list but was rather set via the call to ComputeUIInputs() that occurs in the constructor. With this CL |security_level_| *needs* to be set in the initialization list as that passed-in value is used as input to ComputeUIInputs(), which is now called from InitializeUIState(). Bug: 1052375 Change-Id: I61143f3bdc4e02097d4c27db7f46bfab2355f934 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105296 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by:Colin Blundell <blundell@chromium.org> Reviewed-by:
Carlos IL <carlosil@chromium.org> Reviewed-by:
Emily Stark <estark@chromium.org> Cr-Commit-Position: refs/heads/master@{#752426}
Showing
Please register or sign in to comment