Fix crash with composited layers - DO NOT MERGE

Cherry-pick from master

When we have composited layers inside iframes/frames, the layers
hierarchy is not always up to date at the time of the layerSync()
call. If some of those layers are scheduled to be repainted, the
repaint operation will triggers the update of the composited layers
tree -- possibly resulting in the deallocation of the very same
GraphicsLayer we were painting from, and thus leading to a crash.

The fix consist in gathering all the root RenderLayer (for each
frame containing composited layers) and explicitely asking
RenderLayerCompositor to check if the composited tree needs to be
updated, before we traverse the tree to paint the elements.

bug:5695185
Change-Id: I33a00b847eb19c9aa4b68f0ac3adbe36709ed00b
Return the tile generation thread to default priority.

With this partial revert of ececd484e5832707be4a73b70da37f862eb14c35 , single core devices can't have tile generation starved by javascript/plugins.

bug:5746432
Change-Id: I42b5799f4ba136e1c6f9812219824d21390bace2
Enable History API. Do not merge.

Cherry pick Ic6b6860ca4bfe891e84fb0445d67c7ea728c6fe3

The HTML5 History API is disabled at runtime by default in WebKit.
Configure it to be enabled.

Bug: 5767904
Change-Id: Ib7374e0145c581588990baec6e67025c1b7ef693
When in singlesurfacemode, resist switching out - DO NOT MERGE

cherry-pick of https://android-git.corp.google.com/g/#/c/155078/ into MR1 branch
bug:5660814

We want to avoid swapping in and out of singlesurface mode when we have enough
textures to hold the content, but not while the content is updating.

Change-Id: I3c45f2b9f3c8e06b397b701fb53ac6ac5ff8efdd
When loading new content, reset zoom state - DO NOT MERGE

cherry-pick of https://android-git.corp.google.com/g/#/c/155121/2 into MR1 branch
bug:5757950
Change-Id: I34042e8b1f1adf1fc1826d7fde5500708bef3b60
Merge "When loading new content, reset zoom state - DO NOT MERGE" into ics-mr1
Merge "When in singlesurfacemode, resist switching out - DO NOT MERGE" into ics-mr1
am 41aebb2b: Return the tile generation thread to default priority.

* commit '41aebb2b842adadd00ec4d6682160e05d4e24f63':
  Return the tile generation thread to default priority.
am 2cc4497f: Merge "When loading new content, reset zoom state - DO NOT MERGE" into ics-mr1

* commit '2cc4497f17622689c7cd981e220795762660df5c':
  When loading new content, reset zoom state - DO NOT MERGE
am 08a2aede: Merge "When in singlesurfacemode, resist switching out - DO NOT MERGE" into ics-mr1

* commit '08a2aede30839b296a2fad9d27939c4aaa6ccbb1':
  When in singlesurfacemode, resist switching out - DO NOT MERGE
Merge "Fix crash with composited layers - DO NOT MERGE" into ics-mr1
Merge "Enable History API. Do not merge." into ics-mr1
am d13df54b: Merge "Fix crash with composited layers - DO NOT MERGE" into ics-mr1

* commit 'd13df54b67ff2373e79cf6c70bd2369e556ec9c0':
  Fix crash with composited layers - DO NOT MERGE
am f62e398f: Merge "Enable History API. Do not merge." into ics-mr1

* commit 'f62e398f3b87d76e44d18441fa090c18dcc8be82':
  Enable History API. Do not merge.
merge in ics-mr1-release history after reset to ics-mr1
Reconcile with ics-mr1-release

Change-Id: Ie2281e8fe54d8934b4caab74b6040bb786bb3af6
Fully invalidate the pictureset when content size changes

bug:5759299

Webkit invals aren't correct when the content size changes (even simply growing
vertically), for now just repaint from scratch in that case.

Change-Id: I408b289bfee1139d6c8f3c7babd963d217cb5bc0
am b627d5bd: Fully invalidate the pictureset when content size changes

* commit 'b627d5bd0e9b9a4d02131ef694467bfb62b9fb7f':
  Fully invalidate the pictureset when content size changes
merge in ics-mr1-release history after reset to ics-mr1
Reconcile with ics-mr1-release

Change-Id: Ia3e059c74ee6039f1e8a1c9977987865f1156df6