Bug 144969 - Work around HTMLMediaElement::documentDidResumeFromPageCache being called twice
Summary: Work around HTMLMediaElement::documentDidResumeFromPageCache being called twice
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-13 13:49 PDT by Eric Carlson
Modified: 2015-05-13 14:21 PDT (History)
4 users (show)

See Also:


Attachments
Proposed patch. (1.14 KB, text/plain)
2015-05-13 13:56 PDT, Eric Carlson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2015-05-13 13:49:27 PDT
HTMLMediaElement::documentDidResumeFromPageCache is called twice when a page is restored from the page cache, which causes Document::addPlaybackTargetPickerClient to assert in a debug build and to add the client twice in a release build.
Comment 1 Eric Carlson 2015-05-13 13:56:39 PDT
Created attachment 253057 [details]
Proposed patch.
Comment 2 Radar WebKit Bug Importer 2015-05-13 13:57:34 PDT
<rdar://problem/20942403>
Comment 3 Alexey Proskuryakov 2015-05-13 13:58:28 PDT
Comment on attachment 253057 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=253057&action=review

> Source/WebCore/dom/Document.cpp:6556
> -    ASSERT(!m_clientToIDMap.contains(&client));
> +    if (m_clientToIDMap.contains(&client))
> +        return;

Seems worth a FIXME with a bug number.
Comment 4 Eric Carlson 2015-05-13 14:16:35 PDT
(In reply to comment #3)
> Comment on attachment 253057 [details]
> Proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253057&action=review
> 
> > Source/WebCore/dom/Document.cpp:6556
> > -    ASSERT(!m_clientToIDMap.contains(&client));
> > +    if (m_clientToIDMap.contains(&client))
> > +        return;
> 
> Seems worth a FIXME with a bug number.

Indeed. I filed https://webkit.org/b/144970, will reference it in code.
Comment 5 Eric Carlson 2015-05-13 14:21:34 PDT
Committed r184306: https://trac.webkit.org/r184306