Oilpan: Use weak pointers in StyleSheetContents caches.

This fixes use-after-free that could occur when StyleSheetContents
dies when an allocation happens during insertion of a new
StyleSheetContents. Using the built-in weak processing this will
not happen because the iterator used during insertion will keep
the StyleSheetContents alive.

This is relanding the change and depends on thread-local
weak processing to not crash when performing weak processing
which can deallocate an AtomicStringImpl.

R=erik.corry@gmail.com, oilpan-reviews@chromium.org, vegorov@chromium.org, haraken@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168860 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Paper over a recent null-ptr crash regression in SVGImage

I don't like this patch, but this unblock's Karen's
ability to roll, while we decide if we're going to
roll out the recent SVGImage page-destruction deferal
code or if we can add a test for this ASSERT and
clarify the lifetime so that others who might expect
to still have a Page object don't have similar confusion.

BUG=350907
TBR=haraken

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168861 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Convert CompositingLayerMapping code to use reference

RenderLayer is never null in CompositingLayerMapping and should be reference.
Using references safer for caller methods.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168862 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add additional test to verify that setMediaKeys() can be called before setting .src on HTMLMediaElement.

BUG=349546
TEST=new layout test passes

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168863 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Refactoring source image usage in CanvasRenderingContext2D

This change fixes a number of spec compliance and unsupported use case
issues with the drawImage and createPattern canvas API methods.

The CanvasImageSource abstration was added to greatly simplify
code in CanvasRenderingContext2D and make the code more
maintainable for future improvements to drawImage.

BUG=347265,347229,343916,343662,113592
R=senorblanco@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168864 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Try both Sans and Arial for last resort fallback font

Arial may be unavailable on some Linux platforms.

BUG=350976
TEST=FontCacheTest.getLastResortFallbackFont

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168865 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Convert RenderLayerCompositor::RenderView code to use reference

RenderView is never null in RenderLayerCompositor and should be reference.
Using references is safer for caller methods as well.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168866 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rename allowCookies to allowStoredCredentials

And remove an redundant flag from WebURLRequest.
These two represent the same thing thus should be merged.

TEST=none
BUG=none
R=japhet@chromium.org, abarth@chromium.org, darin@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168867 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[SVG] RenderSVGImage may taint its GraphicsContext state.

After r166180, RenderSVGImage::paint() avoids
saving its context state when there is no local transform. But
SVGRenderingContext::prepareToRenderSVGContent() may change the clip
wihout saving, so we must also save/restore when instantiating a
SVGRenderingContext.

BUG=349701
R=schenney@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168868 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[webcrypto] Change HMAC key generation length from bytes to bits.

Matches the upstream change in the spec:
https://dvcs.w3.org/hg/webcrypto-api/rev/da045968abe0

Corresponding chromium-side change:
https://codereview.chromium.org/187103003/

BUG=245025

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168869 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Recompute compositing geometry state after a WebGL context is restored after being lost.

This behavior was lost by crrev.com/177203007, which also removed a bunch of work that breaks chicken-egg compositing ordering in Blink. This CL re-adds only the necessary compositing dirty bit, and so does not reintroduce the chicken-egg issue.

BUG=349195

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168870 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add virtual destructor WebDevice(Motion|Orientation)Listener

[minor nit] A class having any virtual function, should have a virtual
destructor.

BUG=

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

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