Bug 147398

Summary: Avoid unnecessarily constructing PlatformMediaSessionManager on Document destruction
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: MediaAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, jer.noble
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-07-28 21:18:56 PDT
When looking at a benchmark trace, I saw the following:
54,16.2%,15.5%,WebCore::HTMLDocument::~HTMLDocument() (in WebCore)
54,16.2%,15.5%,    WebCore::Document::~Document() (in WebCore)
54,16.2%,15.5%,        WebCore::PlatformMediaSessionManager::sharedManager() (in WebCore)
54,16.2%,15.5%,            WebCore::MediaSessionManageriOS::MediaSessionManageriOS() (in WebCore)
54,16.2%,15.5%,                -[WebMediaSessionHelper initWithCallback:] (in WebCore)
54,16.2%,15.5%,                    -[WebMediaSessionHelper allocateVolumeView] (in WebCore)
50,15.0%,14.4%,                        -[MPVolumeView initWithFrame:style:] (in MediaPlayer)
4,1.2%,1.2%,                        initMPVolumeView() (in WebCore)

We end up constructing a PlatformMediaSessionManager when destroying a Document, because of a call to PlatformMediaSessionManager::shared().stopAllMediaPlaybackForProcess(). This seems unfortunate.
Comment 1 Chris Dumez 2015-07-28 21:24:02 PDT
Created attachment 257730 [details]
Patch
Comment 2 WebKit Commit Bot 2015-07-29 00:18:03 PDT
Comment on attachment 257730 [details]
Patch

Clearing flags on attachment: 257730

Committed r187544: <http://trac.webkit.org/changeset/187544>
Comment 3 WebKit Commit Bot 2015-07-29 00:18:09 PDT
All reviewed patches have been landed.  Closing bug.