Changeset 183185 in webkit
- Timestamp:
- Apr 23, 2015, 8:49:47 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
dom/Document.cpp (modified) (5 diffs)
-
dom/Document.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r183183 r183185 1 2015-04-23 Eric Carlson <eric.carlson@apple.com> 2 3 Some media tests assert after r183096 4 https://bugs.webkit.org/show_bug.cgi?id=144098 5 6 Reviewed by Darin Adler. 7 8 * dom/Document.cpp: 9 (WebCore::Document::removePlaybackTargetPickerClient): Don't assert if the client has already 10 been removed from the map. This happens when a media element is removed from the document 11 before its destructor runs and is not an error. 12 (WebCore::Document::showPlaybackTargetPicker): It is an error to call this after the client 13 has been removed from the map so leave the assert in a debug build, but return early 14 so a release build doesn't crash. 15 (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto. 16 (WebCore::Document::playbackTargetAvailabilityDidChange): Use "auto" for the map iterator variable. 17 (WebCore::Document::setPlaybackTarget): Ditto. 18 (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto. 19 * dom/Document.h: Fix map typedef names. 20 1 21 2015-04-23 Andreas Kling <akling@apple.com> 2 22 -
trunk/Source/WebCore/dom/Document.cpp
r183096 r183185 6551 6551 void Document::removePlaybackTargetPickerClient(MediaPlaybackTargetClient& client) 6552 6552 { 6553 ASSERT(m_clientToIDMap.contains(&client)); 6554 uint64_t contextId = m_clientToIDMap.get(&client); 6555 m_idToClientMap.remove(contextId); 6556 m_clientToIDMap.remove(&client); 6553 const auto& it = m_clientToIDMap.find(&client); 6554 if (it == m_clientToIDMap.end()) 6555 return; 6556 6557 uint64_t clientId = it->value; 6558 m_idToClientMap.remove(clientId); 6559 m_clientToIDMap.remove(it); 6557 6560 6558 6561 Page* page = this->page(); 6559 6562 if (!page) 6560 6563 return; 6561 page->removePlaybackTargetPickerClient(c ontextId);6564 page->removePlaybackTargetPickerClient(clientId); 6562 6565 } 6563 6566 … … 6568 6571 return; 6569 6572 6570 ASSERT(m_clientToIDMap.contains(&client)); 6571 page->showPlaybackTargetPicker(m_clientToIDMap.get(&client), view()->lastKnownMousePosition(), isVideo); 6573 const auto& it = m_clientToIDMap.find(&client); 6574 ASSERT(it != m_clientToIDMap.end()); 6575 if (it == m_clientToIDMap.end()) 6576 return; 6577 6578 page->showPlaybackTargetPicker(it->value, view()->lastKnownMousePosition(), isVideo); 6572 6579 } 6573 6580 … … 6578 6585 return; 6579 6586 6580 ASSERT(m_clientToIDMap.contains(&client)); 6581 page->playbackTargetPickerClientStateDidChange(m_clientToIDMap.get(&client), state); 6587 const auto& it = m_clientToIDMap.find(&client); 6588 ASSERT(it != m_clientToIDMap.end()); 6589 if (it == m_clientToIDMap.end()) 6590 return; 6591 6592 page->playbackTargetPickerClientStateDidChange(it->value, state); 6582 6593 } 6583 6594 6584 6595 void Document::playbackTargetAvailabilityDidChange(uint64_t clientId, bool available) 6585 6596 { 6586 TargetClientToIdMap::iteratorit = m_idToClientMap.find(clientId);6597 const auto& it = m_idToClientMap.find(clientId); 6587 6598 if (it == m_idToClientMap.end()) 6588 6599 return; … … 6593 6604 void Document::setPlaybackTarget(uint64_t clientId, Ref<MediaPlaybackTarget>&& target) 6594 6605 { 6595 TargetClientToIdMap::iteratorit = m_idToClientMap.find(clientId);6606 const auto& it = m_idToClientMap.find(clientId); 6596 6607 if (it == m_idToClientMap.end()) 6597 6608 return; … … 6602 6613 void Document::setShouldPlayToPlaybackTarget(uint64_t clientId, bool shouldPlay) 6603 6614 { 6604 TargetClientToIdMap::iteratorit = m_idToClientMap.find(clientId);6615 const auto& it = m_idToClientMap.find(clientId); 6605 6616 if (it == m_idToClientMap.end()) 6606 6617 return; -
trunk/Source/WebCore/dom/Document.h
r183169 r183185 1689 1689 1690 1690 #if ENABLE(WIRELESS_PLAYBACK_TARGET) 1691 typedef HashMap<uint64_t, WebCore::MediaPlaybackTargetClient*> Target ClientToIdMap;1692 Target ClientToIdMap m_idToClientMap;1693 typedef HashMap<WebCore::MediaPlaybackTargetClient*, uint64_t> Target IdToClientMap;1694 Target IdToClientMap m_clientToIDMap;1691 typedef HashMap<uint64_t, WebCore::MediaPlaybackTargetClient*> TargetIdToClientMap; 1692 TargetIdToClientMap m_idToClientMap; 1693 typedef HashMap<WebCore::MediaPlaybackTargetClient*, uint64_t> TargetClientToIdMap; 1694 TargetClientToIdMap m_clientToIDMap; 1695 1695 #endif 1696 1696 };
Note:
See TracChangeset
for help on using the changeset viewer.