Bug 144969

Summary: Work around HTMLMediaElement::documentDidResumeFromPageCache being called twice
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, kangil.han, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch. none

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