LinkHighlights compositor animations: Add an ASSERT
LinkHighlights compositor animations: Add an ASSERT

The actual fix was here: https://codereview.chromium.org/1509013002

1) We have
class WebViewImpl {
    Vector<OwnPtr<LinkHighlightImpl>> m_linkHighlights;
    OwnPtr<WebCompositorAnimationTimeline> m_linkHighlightsTimeline;
};
declared.

2) So the order of destruction is the opposite for the order of declaration:
m_linkHighlightsTimeline object first, m_linkHighlights object second.

3) Each LinkHighlightImpl has a m_owningWebViewImpl link to the owner (WebViewImpl).

4) In LinkHighlightImpl destructor we access WebViewImpl::m_linkHighlightsTimeline with the code:
        if (m_owningWebViewImpl->linkHighlightsTimeline())
            m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);

5) So we access the object which lifetime is over.
It worked in clang AND gcc on Nexus 7 with Android 5.1.1.
It didn't work in gcc on Nexus 4 with Android 5.0.1.

6) If you swap the order of declaration:
class WebViewImpl {
    OwnPtr<WebCompositorAnimationTimeline> m_linkHighlightsTimeline;
    Vector<OwnPtr<LinkHighlightImpl>> m_linkHighlights;
}
then it _always_ works.

7) We don't want to depend on any order, so let's put assertion that we don't have any m_linkHighlights in WebViewImpl destruction.

BUG=567436

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

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#364548}

axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk