[webkit] Runtime enablement of WebGL

Hook up debug setting to enable/disable WebGL.

(cherry-picked from commit 69ee15e5b0bc1e0b2d41d80f9f5247b826c62ceb)

Change-Id: Ib07427378450a858d6b6308e23b5e1aaac002dd3
[webkit]Change the thread priority

Change the values used to dynamically modify thread priority to
improve scrolling and pinc to zoom use cases.

Change-Id: I861b3042079058fdd614390c563f23d3cab3acd9
[webkit] Postpone sending scroll message to webcore thread

Post a message to the UI thread instead, to send the
scroll message later. Thus reduce the computation until
currnet scrolling finishes

Change-Id: Iff94af37e9070e63e0797195c7588343ab077bb3
webkit: Support video frame capture for HTML5 canvas use cases

Includes several patches cherry-picked from jb branch.

[webkit] Expose check for playlist types to WebKit

Need to black list types that may have multiple security origins. The
MediaPlayer should be the source of this knowledge.

Change-Id: Ice5a73f94f389e9d74804d9f0a0f4746a35ae79d

[webkit] Set the visibility of the video element from JNI

Avoid invalidates of FrameView when video is not visible.

Change-Id: I25065ed8771dae3a72248df40d66f2e9006ac797

Conflicts:

	core/java/android/webkit/HTML5VideoView.java
	core/java/android/webkit/HTML5VideoViewProxy.java

webkit: Notify native MediaPlayer when the first video frame is available

This callback will be used by the webkit MediaPlayer to advance the
ready state. This provides a more accurate mapping of ready states to
the state of the framework MediaPlayer.

Fixed bug where video playback cannot be started after preloading
metadata.

Change-Id: I5312fc9e1b742e1862fdfa2304e554ae3cdb2b2e

Conflicts:

	core/java/android/webkit/HTML5VideoFullscreen.java
	core/java/android/webkit/HTML5VideoView.java
	core/java/android/webkit/HTML5VideoViewProxy.java

Add native layer callback to update media player state

Native video layer needs prompt updates on media player state changes
so that it can composite the video frame as soon as possible.
Video frame capture also needs up-to-date media player state so that
it does not capture empty frames when media player is ready.

Previously, media player state updates to native layer are only done
when a new base layer is set.

CRs-Fixed: 426323
webkit: Fix for unable to play youtube in browser

Youtube video was not playing because it is getting paused during
load by HTML5VideoViewProxy in the setBaseLayer call.  Fixed by
adding a condition in setBaseLayer to only pause the video if the frame
available notification has been sent.  The frame available flag in
HTML5VideoViewProxy should only be set after the native media player has
been notified.

Renamed onVideoFrameAvailable function for consistency and readability.

Change-Id: I9dcca5447c0d8697031441d43d91c2c0ed83be00
CRs-fixed: 458557
webkit: Manage video playing state properly when browser goes to background

When the browser activity goes to background while video is playing in
fullscreen mode, two things happen around the same time. The native media
player resumes the video playback using the inline video view while the
BrowserActivity notifies WebView that activity is going to the background
which in turn pauses the video. Depending on the order of these calls,
the play call may happen after the pause which causes video to resume
while the browser activity is in the background.

This is fixed by handling the video state properly during exit
fullscreen so that the messages may arrive at any order and the browser
still behaves correctly.

Change-Id: Ie7e037ecde7663b8cac704e3ab56a064bd52f6cf
CRs-fixed: 451660
BT: Fix memory leak when BT on & off done many times

Solves a memory leak in BatteryStatsService when Bluetooth
is turn on/off. Solution adds missing close of proxy then
Bluetooth is turned off.

Change-Id: I65f9db298459c7c15f6a10c752992f1d38469445
CRs-Fixed: 476145