Bug 188094

Summary: [Media] Avoid unnecessarily constructing *TrackList objects
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: MediaAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, jer.noble, jonlee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 187284    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2018-07-27 08:56:43 PDT
Avoid unnecessarily constructing *TrackList objects. For e.g.:
1   com.apple.WebCore             	0x00007fff4ef9ca1e WebCore::TextTrackList::TextTrackList(WebCore::HTMLMediaElement*, WebCore::ScriptExecutionContext*) + 14
2   com.apple.WebCore             	0x00007fff4ef9ed48 WebCore::HTMLMediaElement::textTracks() + 56
3   com.apple.WebCore             	0x00007fff4f293aca WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions() + 122
4   com.apple.WebCore             	0x00007fff4f29343e WebCore::PlaybackSessionModelMediaElement::updateForEventName(WTF::AtomicString const&) + 1742
5   com.apple.WebCore             	0x00007fff4f29286f WebCore::PlaybackSessionModelMediaElement::setMediaElement(WebCore::HTMLMediaElement*) + 1103
6   com.apple.WebKit              	0x00007fff509a603c WebKit::PlaybackSessionManager::setUpPlaybackControlsManager(WebCore::HTMLMediaElement&) + 542
7   com.apple.WebCore             	0x00007fff4fca9b4b WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer() + 235
8   com.apple.WebCore             	0x00007fff4eedf908 WebCore::HTMLMediaElement::stop() + 120
Comment 1 Chris Dumez 2018-07-27 08:58:34 PDT
Created attachment 345915 [details]
Patch
Comment 2 Eric Carlson 2018-07-27 09:48:08 PDT
Comment on attachment 345915 [details]
Patch

Very nice, thanks!
Comment 3 WebKit Commit Bot 2018-07-27 09:58:27 PDT
Comment on attachment 345915 [details]
Patch

Clearing flags on attachment: 345915

Committed r234312: <https://trac.webkit.org/changeset/234312>
Comment 4 WebKit Commit Bot 2018-07-27 09:58:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2018-07-27 09:59:17 PDT
<rdar://problem/42664442>