Make --disable-gpu-vsync work with CoreAnimation

CoreAnimation provides GPU backpressure from the browser process to the
renderer process by only acknowledging frames when they are displayed.
This mechanism has the side-effect of throttling the renderer to about
vsync, because the layer will not request to be displayed much more
than once per vsync.

Relieve this pressure by not going into isAsynchronous mode when
receiving new frames when vsync is disabled.

This exposed an issue where unluckily-timed setNeedsDisplay calls could
be dropped on the floor, hanging the renderer because it would never
get its ack. Work around this by calling setNeedsDisplay and
displayIfNeeded explicitly, and, if the draw is not triggered by that,
sending the ack explicitly. This bug has never triggered without vsync
disabled, but apply the workaround in both situations, to be sure.

Use a ScopedClosureRunner to ensure that the swap ack be issued in
CompositorSwapBuffers, rather than sprinkling ack calls all over the
function. Remove the TODOs because the scoped runner should solve
the problem they were working around.

BUG=245900

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252784 0039d316-1c4b-4281-b951-d872f2087c98
Fixed incorrect resize of docked windows when locking screen.

Switches updating of state_.is_screen_locked to push rather than pull.
is_screen_locked is set when the lock animation starts and unset when
OnLockStateChanged is called with locked unset.
If is_screen_locked is set avoid generating notifications about inset
changes.

BUG=338377

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252785 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 252784
SVN changes up to revision 252785