CSP: Move policy parsing out of Document.

This patch finishes the process of allowing policy parsing outside of
an ExecutionContext, and adjusts Document::initContentSecurityPolicy
to accept a ContentSecurityPolicy object rather than a set of headers.
If such an object is provided, the document will take ownership of it
and use it going forward. If no such object is provided, an empty
policy will be created and stored.

A future patch will move parsing out of FrameLoader::didBeginDocument
into DocumentLoader::responseReceived so that we can begin doing some
checks before a document is created.

BUG=411889

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181811 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add toDouble() helper, and use toFloat()/toDouble() for conversions

Like we do for all integer types, use helper functions from V8Binding.h
to convert from v8::Value to native types. These helper functions throw
all exceptions via their ExceptionState& argument, which means we don't
need to initialize a v8::TryCatch in the caller.

The helpers initialize a v8::TryCatch if they call in to V8 to convert
a value, but they do not do this if the value is already of the correct
type.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181812 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Gardenind: mark http/tests/perf/large-inlined-script.html as flaky

BUG=24182
TBR= jianli@chromium.org
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181813 bbb929c8-8fbe-4397-9dbb-9b2b20218538
CSP: Move parsing a document's CSP to DocumentLoader::responseReceived.

This patch moves CSP generation out of FrameLoader and into
DocumentLoader in order to ensure that the 'frame-ancestors' directive
can properly block loading a document. The current implementation checks
too late in the loading process.

The new implementation works, with the caveat that it breaks both
console messages and violation reports. Since we have no
ExecutionContext, we have nothing to dump console messages into. This
work will be covered in https://crbug.com/412725

BUG=411889,411600,357462

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181814 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Extending supported sample rate from 3.0KHz to 192.0KHz for OfflineAudioContext.

Currently, AudioBuffer is supported 3.0KHz to 192.0 KHz.
However, offlineAudioContext is not supported lower sample rate than 44.0KHz.

http://webaudio.github.io/web-audio-api/#the-audiobuffersourcenode-interface

“Describes the sample-rate of the linear PCM audio data
in the buffer in sample-frames per second.
An implementation must support sample-rates
in at least the range 22050 to 96000”

Changed supported sampleRate range 3KHz to 192KHz and fftsize for convolution.

BUG=394009

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181816 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Mixed Content: Migrate ResourceFetcher to the static mixed content checker.

This patch begins using the static version of the mixed content checker
which was introduced in https://codereview.chromium.org/537983002/. It
also takes the opportunity to rework the error message to use the new
type information we've now passed into the checker.

This patch only touches the ResourceFetcher usage; future patches will
clean up the other points in the code where we grab a MixedContentChecker
from the loader, and eventually remove the object creation entirely.
This will make the site isolation folks happy.

BUG=411184

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181817 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Adds the concept of Policies to the Blink Scheduler

In Normal mode (the default), there's virtually no 
prioritization of compositor events, and
shouldYieldForHighPriorityWork always returns false. In 
CompositorPriority mode, there *is* prioritization of 
compositor tasks and shouldYieldForHighPriorityWork will 
return false if there are pending high priority events.

Currently there is no way for client code to set the policy
but that will be introduced in a follow up CL.

Also adds some disabled by default tracing in
"blink.scheduler" to track the number of pending high
priority tasks and which policy mode the scheduler is in.

BUG=391005,411520

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181818 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[DevTools] Add "never show" link to emulation warning.

BUG=394734

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181819 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: log worker thread ids on the main thread when Timeline recording is enabled

DevTools uses TracingStartedInWorker trace event to figure out which worker threads correspond to the inspected page. The events were written on the worker thread which is racy. Current implementation always writes the event on the main thread. Since Tracing.start/end commands are handled on the main thread this eliminates racy behavior.

BUG=401895,405429

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181820 bbb929c8-8fbe-4397-9dbb-9b2b20218538
CSP: Convert CSPSource constructor bools into a enum.

Rather than passing the wildcard disposition of CSPSource's hosts and ports
as booleans, we should have an enum that allows us to figure out hat we
mean at the callsite. This patch adds CSPSource::WildcardDisposition in
order to make this clear.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181821 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Interface for requestSources through UserMediaController/Client.

This allows MediaStreamTrack::getSources to go through UserMediaClient.

To land after this:
Chrome CL part 1: https://codereview.chromium.org/562643003/
Blink CL part 2: https://codereview.chromium.org/559423002
Chrome CL part 2 (TBD)

BUG=406094

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181822 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert "Merge FontPlatformDataHarfBuzz into FontPlatformData"

This reverts commit 44cef15dcdbf3b78339c3678fe533f3a97e59870.

The patch were reverted due to problem with uninitialized memory.

BUG=413229
TBR= jianli@chromium.org,  dominik.rottsches@intel.com

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181824 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Split out CSSParser public API

This patch separates the public API of BisonCSSParser from the hundreds
of public methods it exposes. The plan is to build a new parser based on
the css-syntax specification, which will eventually complete replace the
bison-based parser. The functions in this class will do the run-time
switching between the bison parser and the new (unwritten) parser.

For the functions here which are only ever used with a newly instantiated
BisonCSSParser, I've moved instantiation to inside the CSSParser so that
the functions can be static.

This is an updated version of a patch by eseidel from 8 months ago:
https://codereview.chromium.org/112933010/

BUG=330389

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181825 bbb929c8-8fbe-4397-9dbb-9b2b20218538
HTML Imports: Let document.defaultView null for imports.

This follows the lates spec update: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23170

R=dglazkov@chromium.org
BUG=408272
TEST=import-defaultView.html, import-script-prototypes.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181826 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix bug in BackwardsCharacterIterator::endPosition introduced in latest change.

TBR=yosin@chromium.org
BUG=388681

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181827 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Manual rebaseline for Chromium r294250

WebTouchEvents passed to plugins no longer use the changedTouches or
targetTouches properties, rebaseline appropriately.

TBR=loislo@chromium.org,jianli@chromium.org
BUG=413098

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181828 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Input tasks are not always routed by the main thread, but the
blink scheduler still needs to know about them because we
want it to enter low latency mode when the user is
interacting with the device.  To facilitate that this patch
adds an didReceiveInputEvent API function.

BUG=391005

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181830 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update codec tests for Android.

I verified manually that the new files differ from the original expected
results by a few bits. I did not investigate the underlying cause for
the difference, but I suspect some changes in ffmpeg is causing these
differences.  Android was using the linux files for the expected
results so changes in ffmpeg can cause Android results to differ since
WebAudio uses Android's MediaCodec framework to decode audio files.

BUG=407368
TBR=dalecurtis@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181831 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Switch blink to use a gin-managed isolate.

This also moves the basic V8 initialization to gin. The main advantage
is that we now initialize V8 first and then start creating isolates. It
also removes some code duplication.

BUG=none
R=haraken@chromium.org,andrewhayden@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181832 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert of CSP: Convert CSPSource constructor bools into a enum. (patchset #1 id:1 of https://codereview.chromium.org/568433002/)

Reason for revert:
Your patch broke quite a number of webkit tests:
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.8%20%28retina%29/builds/19050
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.7/builds/31462

Original issue's description:
> CSP: Convert CSPSource constructor bools into a enum.
> 
> Rather than passing the wildcard disposition of CSPSource's hosts and ports
> as booleans, we should have an enum that allows us to figure out hat we
> mean at the callsite. This patch adds CSPSource::WildcardDisposition in
> order to make this clear.
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181821

TBR=jochen@chromium.org,mkwst@chromium.org
NOTREECHECKS=true
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181833 bbb929c8-8fbe-4397-9dbb-9b2b20218538