lowLatency canvas2D: fix hibernation tab crash
lowLatency 2D contexts would crash the tab when sent to the background;
this is because of the callstack
  HTMLCanvasElement::PageVisibilityChanged()
   CanvasRenderingContext2D::SetIsHidden()
     canvas()->GetCanvas2DLayerBridge()->SetIsHidden(hidden)
     ...
       Canvas2DLayerBridge::Hibernate()
and that tries to destroy its Layer, which has not been created
(because in lowLatency mode we don't use it).
This CL fixes the issue by cutting at SetIsHidden() if there is
no |layer_|.
Test: open https://codepen.io/miguelao/full/ZjJNNw (or any other
trivial sample canvas lowLatency demo), draw something , then
open a new tab. The former tab crashes on ToT, doesn't with this CL.
Bug: 839970, 870873
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6657a72009438cb31fac2b2d874c807b1719d16a
Reviewed-on: https://chromium-review.googlesource.com/1173344Reviewed-by:  Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582913}
Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582913}
Showing
Please register or sign in to comment