Introduce RawBuffer as a backing store for ArrayBufferContents.

Several bits and pieces of core are currently using ArrayBuffer as a generic
dumping ground for temporary byte streams. This impedes our ability to move
ArrayBuffer's implementation completely into V8, as we're creating and
manipulating ArrayBuffer objects in areas devoid of a V8 context. We need the
flexibility of dealing with a raw chunk of memory, but doing it through
ArrayBuffer is simply the wrong long-term solution.

This patch moves most of the heavy memory lifting out of ArrayBufferContents,
and into a new RawBuffer class which will be suitable for use outside the
context of V8. If you're thinking "Hey, ArrayBufferContents isn't doing much
anymore. Can't we kill it?", then you're a very clever person indeed. Handsome,
too.

Subsequent patches will start moving ArrayBuffer usage in core onto RawBuffer
piece by piece.

BUG=239049
R=jochen@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150127 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use OwnPtr instead of deleteAllValues in DocumentMarkerController

Merged from Darin's patch: http://trac.webkit.org/changeset/149654

BUG=239846
R=abarth@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: minor UI tweaks in the settings UI.

R=vsevik@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150129 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix problems with cross-origin redirects.

Three problems exist in the current code:

1) If a same-origin request causes a redirect to a different origin,
   do not enforce access control checks for the redirect response
   itself, because the request which resulted in the redirect was
   same-origin.

2) If a same-origin request causes a redirect to a different origin,
   use the original request's URL as the origin for the new request;
   do not use a unique security origin.

3) Track whether the client (i.e., XMLHttpRequest) actually requested
   that credentials be sent in the first place. When a same-origin
   request redirects to a different origin, the original request will
   send cookies whether requested or not, because it is same-origin.
   The new cross-origin request should not send cookies unless they
   were requested, so that the access control checks on the response
   will succeed if the server granted "Access-Control-Allow-Origin=*".

BUG=226897

Review URL: https://chromiumcodereview.appspot.com/14557011

git-svn-id: svn://svn.chromium.org/blink/trunk@150130 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add WebKit prefix to MediaSource,SourceBuffer, and SourceBufferList objects.

The current MediaSource API implementation is prefixed from JavaScript's point
of view, but is not in the C++ code. I plan to implement an unprefixed version
of the MediaSource API that is consistent with the current spec. The prefixed
version needs to be moved aside to make room for the unprefixed version which
will be quite different because of significant changes to the spec over the last
6 months.

These objects are also being migrated to a new runtime flag to make it possible to
enable/disable the prefixed and unprefixed versions independently.

BUG=239485
TEST=No new tests since this is just a class rename.
R=eseidel@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150131 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Combine GraphicsContextState and PlatformContextSkiaState.

Created a new class GraphicsContextState. Combined struct GraphicsContextState
from GraphicsContext and PlatformContextSkiaState into this new class. Made
almost all methods and members private and GraphicsContext the sole friend of
the class.

Rationalized the overlapping state and fixed up naming conventions.
Removed unused state, although it could use another pass at cleanup.

Moved some enums to the GraphicsTypes header, and fixed the indent there.
Apparently this class came into existence at some point and existing enums
were never moved there.

Modified the state stack to use the Skia version (the current state is on the
stack and we keep a pointer to the top of the stack). Changed the stack to
use OwnPtr as it avoid copying large state structures (we were previously
copying twice for each state push, as far as I can tell).

Fixed the missing paintingDisabled() calls everywhere in GraphicsContext.
Some calling code no longer needs to check this. Will do in a follow-on patch.

Existing tests all behave as expected, so the patch appears to be correct.
We should also be less prone to errors.

BUG=235470
R=pdr@chromium.org, senorblanco@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150132 bbb929c8-8fbe-4397-9dbb-9b2b20218538
This change exposes Skia's implementations of Path::length(), Path::pointAtLength(),
and Path::normalAngleAtLength() which results in a significant performance improvement.

This patch is primarily straightforward though the contour concept differs from Blink:
Skia's concept of subpaths are 'contours' so this patch uses while loops to iterate
over each contour. With this change, Path::pathLengthApplierFunction can be removed.

After this patch PerformanceTests/SVG/SvgCubics.html is 33% faster:
    Before patch: 26.69ms
    After patch: 17.62ms

All text-on-path scenarios should see a similar performance win.

B=227397
R=schenney@chromium.org

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149689

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149899

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150133 bbb929c8-8fbe-4397-9dbb-9b2b20218538
media/track/track-cue-rendering-horizontal.html is flaky

BUG=239913
TBR=vcarbune

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150134 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use OwnPtr instead of deleteAllValues in KeyframeValueList

Also simplifies some boolean return values.

Merged from Darin's patch: http://trac.webkit.org/changeset/149661

BUG=239867
R=pdr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150135 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Another clearLayoutRootIfNeeded crash

BUG=238363
TEST=
TBR=inferno

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150136 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add myself to a few watchlists.

TBR=abarth
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150137 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 150124 "Unifies ScrollView and RenderLayer to use non-shi..."

Broke AutomationRendererHelperTest.RTLSnapshot

> Unifies ScrollView and RenderLayer to use non-shifted [minPos, maxPos] scroll offset
> 
> For pages with negative overflow (due to RTL or writing mode), there are
> two sets of scroll offset defined. One that ranges from [0, maxPos - minPos]
> and the other one ranges from [minPos, maxPos]. To reduce confusion, this
> patch unifies ScrollView and RenderLayer to use the second definition of
> scroll offset.
> 
> BUG=232063
> TEST=manual
> R=jamesr@chromium.org,jchaffraix@chromium.org
> 
> Review URL: https://chromiumcodereview.appspot.com/14807003

TBR=trchen@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150138 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ChildNode interface API

http://dom.spec.whatwg.org/#childnode

Make nextElementSibling and previousElementSibling work on CharacterData and
DocumentType as well as required by the spec.

This does not add any new methods (so the interface is still not complete).

BUG=239829

Review URL: https://chromiumcodereview.appspot.com/14973003

git-svn-id: svn://svn.chromium.org/blink/trunk@150139 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 149981 "Before this change, we would wrongly bail-out fro..."

> Before this change, we would wrongly bail-out from the loop if our ancestor was anonymous. That meant that in some circumstances, we would not notify the right object of the float  removal, leading to tree badness. In this case, these objects were the next sibling blocks containing the overhanging floats. Next sibling blocks need to be determined relative to the containing block / non-anonymous parent.
> 
> BUG=222852
> R=jchaffraix@chromium.org
> 
> Review URL: https://codereview.chromium.org/14759010

TBR=inferno@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150140 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Partial revert of r149766 due to perf regression on dromaeo

Merging FrameLoadeStateMachine states apparently causes a behavior change, add
back in state DisplayingInitialEmptyDocumentPostCommit.

BUG=239029
TEST=none
TBR=abarth

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150141 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Enable resolution media queries with fixed implementation
    
The fixes to the original implementation are partly based on a
patch by Rune Lillesveen <rune@opera.com>

The implementation used the physical resolution to evaluate the
resolution media features. Changed to use the actual CSS resolution,
also known as the device-pixel-ratio, instead. Unified the code for
evaluating the resolution and device-pixel-ratio media features.

Intent to ship thread:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/odQrXmT5vHk

BUG=158744,230393
WKBUG=114029

Review URL: https://chromiumcodereview.appspot.com/14408004

git-svn-id: svn://svn.chromium.org/blink/trunk@150142 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 150133 "This change exposes Skia's implementations of Pat..."

> This change exposes Skia's implementations of Path::length(), Path::pointAtLength(),
> and Path::normalAngleAtLength() which results in a significant performance improvement.
> 
> This patch is primarily straightforward though the contour concept differs from Blink:
> Skia's concept of subpaths are 'contours' so this patch uses while loops to iterate
> over each contour. With this change, Path::pathLengthApplierFunction can be removed.
> 
> After this patch PerformanceTests/SVG/SvgCubics.html is 33% faster:
>     Before patch: 26.69ms
>     After patch: 17.62ms
> 
> All text-on-path scenarios should see a similar performance win.
> 
> B=227397
> R=schenney@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149689
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149899
> 
> Review URL: https://codereview.chromium.org/14621003

TBR=pdr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150143 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 150143 "Revert 150133 "This change exposes Skia's impleme..."

This was rolled out due to memory corruption errors that turned
out to be another patch. Relanding.

TBR=zmo@chromium.org

> Revert 150133 "This change exposes Skia's implementations of Pat..."
> 
> > This change exposes Skia's implementations of Path::length(), Path::pointAtLength(),
> > and Path::normalAngleAtLength() which results in a significant performance improvement.
> > 
> > This patch is primarily straightforward though the contour concept differs from Blink:
> > Skia's concept of subpaths are 'contours' so this patch uses while loops to iterate
> > over each contour. With this change, Path::pathLengthApplierFunction can be removed.
> > 
> > After this patch PerformanceTests/SVG/SvgCubics.html is 33% faster:
> >     Before patch: 26.69ms
> >     After patch: 17.62ms
> > 
> > All text-on-path scenarios should see a similar performance win.
> > 
> > B=227397
> > R=schenney@chromium.org
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149689
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149899
> > 
> > Review URL: https://codereview.chromium.org/14621003
> 
> TBR=pdr@chromium.org
> 
> Review URL: https://codereview.chromium.org/15007008

TBR=zmo@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@150144 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move enableWebSocketSettings flag from RuntimeEnabledFeatures to Settings.

Move enableWebSocketSettings flag from RuntimeEnabledFeatures to Settings because we turn on / off the flag in layout tests.

The flag in WebRuntimeFeatures remains for a while, for compatibility.
This CL breaks some experimental WebSocket features and skipped tests.
I will restore them later.

BUG=238648
R=jochen, tkent

Review URL: https://chromiumcodereview.appspot.com/14576008

git-svn-id: svn://svn.chromium.org/blink/trunk@150145 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Misc FrameLoader cleanup

Delete some unused functions, simplify logic in loadWithNavigationAction.

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/14890015

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