Optimizing the time taken to build and show the WrenchMenu.
Optimizing the time taken to build and show the WrenchMenu.

While adding the ink drop ripple animation to the WrenchToolbarButton I found that the ToolbarView::ShowAppMenu(...) was taking a noticeable amount of time to build and show the menu.
Patch set 1 has some profiling logging added and contains a log_output.txt showing that the majority of time is being spent calculating the string length for the ZoomView.
Patch set 2 includes a fix to cache the max length and prevent it from being calculated more often than it needs to be.  It also contains log_output.txt to show the time improvements.

tldr for log_output.txt: With no functional changes patch set 1 spent 0.090804s creating the WrenchMenu and 0.248378s total time in Canvas::SizeStringFloat(...) over 64 invocations whereas Patch set 2 spent 0.003858s creating the WrenchMenu and 0.202926s total time in Canvas::SizeStringFloat(...) over 42 invocations.

Note: The timings were harvested when running the ChromeOS build on a linux box so the values may be somewhat inflated however the percentage increase is still very dramatic.

BUG=505587

Review URL: https://codereview.chromium.org/1252133002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340691}

Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,Chilledheart/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1