Branch 1916 - blink@r170313

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170401 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 170311 "MemoryCache: make sure that Resources are evicted..."

> MemoryCache: make sure that Resources are evicted only when they can be deleted
> 
> This CL fixes a problem where Resources can be taken out of the cache but not
> deleted (if their handle count is not 0 for example).
> 
> BUG=290193
> 
> Review URL: https://codereview.chromium.org/179943002

TBR=clamy@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170402 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170357 "Revert of Make DOMWrapperWorld::current() return a..."

> Revert of Make DOMWrapperWorld::current() return a reference instead of a pointer (https://codereview.chromium.org/209713003/)
> 
> Also reverting dependent patch https://codereview.chromium.org/213543004
> 
> Reason for revert:
> Likely to have caused memory leaks:
> http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%2BLSan%20Tests%20%282%29/builds/989/steps/browser_tests/logs/stdio#failure1
> 
> (1)
> Direct leak of 32 byte(s) in 1 object(s) allocated from:
>     #0 0x4b50d1 in operator new(unsigned long) /usr/local/google/home/hwennborg/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:62
>     #1 0x9bdfd8a in WebCore::V8PerContextDataHolder::install(v8::Handle<v8::Context>, WTF::PassRefPtr<WebCore::DOMWrapperWorld>) third_party/WebKit/Source/bindings/v8/V8PerContextData.cpp:56
>     #2 0x9bdfa06 in WebCore::V8PerContextData::V8PerContextData(v8::Handle<v8::Context>, WTF::PassRefPtr<WebCore::DOMWrapperWorld>) third_party/WebKit/Source/bindings/v8/V8PerContextData.cpp:108
>     #3 0x9bc1afd in WebCore::V8PerContextData::create(v8::Handle<v8::Context>, WTF::PassRefPtr<WebCore::DOMWrapperWorld>) third_party/WebKit/Source/bindings/v8/V8PerContextData.h:66:16
>     #4 0x9be64fc in WebCore::V8PerIsolateData::ensureDomInJSContext() third_party/WebKit/Source/bindings/v8/V8PerIsolateData.cpp:132
> 
> (2)
> Indirect leak of 40 byte(s) in 1 object(s) allocated from:
>     #0 0x4b50d1 in operator new(unsigned long) /usr/local/google/home/hwennborg/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:62
>     #1 0x9b2ee18 in operator new third_party/WebKit/Source/bindings/v8/DOMWrapperWorld.cpp:59:22
>     #2 0x9b2ee18 in WebCore::DOMWrapperWorld::create(int, int) third_party/WebKit/Source/bindings/v8/DOMWrapperWorld.cpp:53
>     #3 0x9be64e7 in WebCore::V8PerIsolateData::ensureDomInJSContext() third_party/WebKit/Source/bindings/v8/V8PerIsolateData.cpp:132
>  
> (3)
> Indirect leak of 24 byte(s) in 1 object(s) allocated from:
>     #0 0x4b46c1 in __interceptor_malloc /usr/local/google/home/hwennborg/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:75
>     #1 0x62caf0a in partitionAllocGenericFlags third_party/WebKit/Source/wtf/PartitionAlloc.h:533
>     #2 0x62caf0a in partitionAllocGeneric third_party/WebKit/Source/wtf/PartitionAlloc.h:549
>     #3 0x62caf0a in WTF::fastMalloc(unsigned long) third_party/WebKit/Source/wtf/FastMalloc.cpp:125
>     #4 0x9b2ed61 in operator new third_party/WebKit/Source/wtf/RefCounted.h:175
>     #5 0x9b2ed61 in WebCore::DOMWrapperWorld::create(int, int) third_party/WebKit/Source/bindings/v8/DOMWrapperWorld.cpp:53
> 
> Original issue's description:
> > Make DOMWrapperWorld::current() return a reference instead of a pointer
> > 
> > Now that it's guaranteed that DOMWrapperWorld is not 0 at any given time, we can make it a reference instead of a pointer.
> > 
> > BUG=341032
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170261
> 
> TBR=jochen@chromium.org,dcarney@chromium.org,abarth@chromium.org,haraken@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=341032
> 
> Review URL: https://codereview.chromium.org/217053007

TBR=enne@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170404 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170336 "Revert "Change event handling order in HTMLPlugInE..."

> Revert "Change event handling order in HTMLPlugInElement."
> 
> This reverts commit fada04e1ba92f2e951341da3ef52145dc96297bf.
> 
> This change affected the behavior of flash on google maps. I'm reverting this
> for now to get rid of this regression. I hope to address this in a future change
> by altering this behavior only for non-Flash PPAPI applications.
> 
> BUG=324351,356089
> TBR=eseidel
> 
> Review URL: https://codereview.chromium.org/212893005

TBR=teravest@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170603 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170352 "Re-apply Remove applyAuthorStyles flag from Shadow..."

> Re-apply Remove applyAuthorStyles flag from ShadowRoot. (https://codereview.chromium.org/215313003/)"
> 
> A triple-revert to rea-pply https://src.chromium.org/viewvc/blink?revision=165673&view=revision.
> 
> BUG=357151
> TBR=tkent
> 
> Review URL: https://codereview.chromium.org/216383005

TBR=dglazkov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170622 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170339 "Handle very large images correctly"

> Handle very large images correctly
> 
> Large images may get downscaled during decoding to keep them within
> the configured memory limits. When this happens while loading a WebGL
> texture, bail out because otherwise the resulting texture will not have
> the correct dimensions nor contents.
> 
> Tested with Nexus 5.
> 
> BUG=356181
> TEST=fast/canvas/webgl/webgl-large-texture.html
> R=kbr@chromium.org
> 
> Review URL: https://codereview.chromium.org/215713002

TBR=skyostil@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170644 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170344 "[DevTools] Fix inspector overlay page visual glitc..."

> [DevTools] Fix inspector overlay page visual glitches.
> 
> Turned out that changing z-index on :active is not working properly.
> 
> BUG=357547,326416
> 
> Review URL: https://codereview.chromium.org/216883006

TBR=dgozman@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170647 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170577 "DevTools: disable CSS agent on disconnect."

> DevTools: disable CSS agent on disconnect.
> 
BUG=358534
> R=apavlov@chromium.org
> 
> Review URL: https://codereview.chromium.org/221033003

TBR=pfeldman@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170685 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170637 "Only support AddFeatures invalidation set mode for..."

> Only support AddFeatures invalidation set mode for :host or
> :any in selector components to the right of the rightmost
> descendant relation.
> 
> This fixes a bug that caused this to be the case accidentally in cases such as:
> 
> :host(.foo) #bar
> 
> when #bar is not (yet) supported for the style invalidation
> tree walk.
> 
> BUG=358704
> 
> Review URL: https://codereview.chromium.org/221643002

TBR=chrishtr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170691 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170611 "Check for null selectors when looping in findBestR..."

> Check for null selectors when looping in findBestRuleSetAndAdd.
> 
> This is necessary because a relation() of SubSelector does not in all cases guarantee that tagHistory() is non-NULL.
> 
> This happens in particular for this selector:
> 
> af|inputtext:focus::content { ... }
> 
> BUG=358475
> 
> Review URL: https://codereview.chromium.org/218403012

TBR=chrishtr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170694 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170494 "Disable the thread-safe MQ parser for main thread"

> Disable the thread-safe MQ parser for main thread
> 
> This reverts commit d1eea2e66e64c3c019885ad7e94933aa0fc05576.
> On top of that, this CL makes sure that only the preloader uses the thread safe MQ parser. That's in order to reduce the risk of breaking content when introducing the new MQ parser.
> 
> BUG=358078
> 
> Review URL: https://codereview.chromium.org/219183002

TBR=yoav@yoav.ws

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170712 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 167941 "Fix ASSERT failure in RenderGeomtryMap for SVGs"

> Fix ASSERT failure in RenderGeomtryMap for SVGs
> 
> SVGRenderSupport::mapLocalToContainer() was trying to apply transforms
> in the incorrect order. Specifically, it would attempt to apply its
> localToParentTransform before its localToBorderBoxTransform. This
> was causing an ASSERT to fail when the computed transforms didn't
> match up to those computed by RenderGeometryMap.
> 
> BUG=302719
> 
> Review URL: https://codereview.chromium.org/143363004

TBR=hartmanng@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170713 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170452 "DevTools: promote CodeMirror scrollbars to a discr..."

> DevTools: promote CodeMirror scrollbars to a discrete rendering layer
> 
> This patch is a workaround for compositing bug observed on MacBook Pro
> with retina display.
> 
> BUG=358161
> 
> Review URL: https://codereview.chromium.org/219413003

TBR=lushnikov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170753 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170450 "[DevTools] Resize FilteredItemSelectionDialog to b..."

> [DevTools] Resize FilteredItemSelectionDialog to be always visible.
> 
> BUG=358112
> 
> Review URL: https://codereview.chromium.org/218733004

TBR=dgozman@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170767 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 170248 "Revert of Revert of Make start/stop loading notif..."

> Revert of Revert of Make start/stop loading notifications per-frame (https://codereview.chromium.org/215533004/)
> 
> Reason for revert:
> r170192 was not a culprit.
> 
> 
> Original issue's description:
> > Revert of Make start/stop loading notifications per-frame (https://codereview.chromium.org/183793002/)
> > 
> > Reason for revert:
> > Possibly causing content_browsertests EndToEnd to fail.
> > 
> > See: http://build.chromium.org/p/chromium.webkit/builders/Linux%20Tests%20%28dbg%29/builds/2095/steps/content_browsertests/logs/stdio
> > 
> > Output:
> > [20917:20917:0327/122353:3268961829:INFO:CONSOLE(0)] "Uncaught TypeError: Cannot convert undefined or null to object", source: http://127.0.0.1:34379/files/web_ui_mojo.html (0)
> > [20917:20917:0327/122353:3269022437:INFO:CONSOLE(28)] "Uncaught TypeError: undefined is not a function", source: http://127.0.0.1:34379/files/web_ui_mojo.js (28)
> > BrowserTestBase signal handler received SIGTERM. Backtrace:
> > #0 0x000000a593be base::debug::StackTrace::StackTrace()
> > #1 0x000002bfc17b content::(anonymous namespace)::DumpStackTraceSignalHandler()
> > #2 0x7f9c3e4ab4a0 <unknown>
> > #3 0x7f9c3e55da43 __poll
> > #4 0x7f9c42aabff6 <unknown>
> > #5 0x7f9c42aac124 g_main_context_iteration
> > #6 0x000000aaaf5f base::MessagePumpGlib::RunWithDispatcher()
> > #7 0x000000a8e802 base::RunLoop::Run()
> > #8 0x00000058256e content::(anonymous namespace)::WebUIMojoTest_EndToEnd_Test::RunTestOnMainThread()
> > 
> > Original issue's description:
> > > Make start/stop loading notifications per-frame
> > > 
> > > Also, make ProgressTracker a frame-level concept rather than a page-level concept and merge it with FrameLoader's FrameProgressTracker helper. Send per-frame progress change notifications accordingly.
> > > 
> > > This depends on https://codereview.chromium.org/180113003/ landing in chromium.
> > > 
> > > BUG=347643
> > > 
> > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170192
> > 
> > TBR=abarth@chromium.org,japhet@chromium.org
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=347643
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170218
> 
> TBR=abarth@chromium.org,japhet@chromium.org,enne@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=347643
> 
> Review URL: https://codereview.chromium.org/216083002

TBR=tkent@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170797 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170700 "Fix scrolling fixed objects containing abs pos obj..."

> Fix scrolling fixed objects containing abs pos objects
> 
> Need to recalculate the repaint rects for children inside fixed objects when we
> find the repaint rects for fixed objects after scrolling so we invalidate the fixed
> objects with the correct scroll position.
> 
> BUG=358550
> 
> Review URL: https://codereview.chromium.org/222473004

TBR=ykyyip@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170804 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170565 "Quota: Add null check"

> Quota: Add null check
> 
> StorageQuotaClient can be null in some contexts.
> 
> 
> BUG=346577
> TEST=run the failed test locally (see the issue)
> 
> Review URL: https://codereview.chromium.org/212123005

TBR=nhiroki@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170840 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170436 "Revert of [DevTools] Don't handle shortcuts while ..."

> Revert of [DevTools] Don't handle shortcuts while dialog is open. (https://codereview.chromium.org/214453003/)
> 
> Reason for revert:
> We should still intercept browser shortcuts, even with dialog open.
> 
> Original issue's description:
> > [DevTools] Don't handle shortcuts while dialog is open.
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170294
> 
> TBR=apavlov@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> 
> Review URL: https://codereview.chromium.org/219013004

TBR=dgozman@chromium.org
BUG=358079

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170844 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170442 "[DevTools] Don't handle shortcuts while dialog is ..."

> [DevTools] Don't handle shortcuts while dialog is open.
> 
> Review URL: https://codereview.chromium.org/219133002

TBR=dgozman@chromium.org
BUG=358079

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170847 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 170346 "Fix for race condition in 2D canvas teardown"

> Fix for race condition in 2D canvas teardown
> 
> We currently sometimes have Canvas2DLayerBridge objects referenced by
> the Canvas2DLayerManager even though they are slated for destruction.
> There is a race condition with the rate limiting mechanism that can
> cause limitPendingFrames() to be called on a defunct layer bridge,
> which may or may not cause a crash.
> 
> This change fixes the bug by ensuring that all transient resources are
> properly freed when a canvas layer has its destruction in progress.
> The added ASSERTs serve as regression tests for this issue when running
> layout tests with accelerated 2D canvases.
> 
> BUG=344666
> TEST=virtual/gpu/fast/canvas Layout tests
> 
> Review URL: https://codereview.chromium.org/216473007

TBR=junov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/1916@170893 bbb929c8-8fbe-4397-9dbb-9b2b20218538