Title: [199671] trunk/Source/WebKit2
Revision
199671
Author
jer.no...@apple.com
Date
2016-04-18 09:04:07 -0700 (Mon, 18 Apr 2016)

Log Message

REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
https://bugs.webkit.org/show_bug.cgi?id=156648

Reviewed by Darin Adler.

Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
.contains() & .get().

* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (199670 => 199671)


--- trunk/Source/WebKit2/ChangeLog	2016-04-18 15:54:50 UTC (rev 199670)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-18 16:04:07 UTC (rev 199671)
@@ -1,3 +1,17 @@
+2016-04-18  Jer Noble  <jer.no...@apple.com>
+
+        REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
+        https://bugs.webkit.org/show_bug.cgi?id=156648
+
+        Reviewed by Darin Adler.
+
+        Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
+        .contains() & .get().
+
+        * WebProcess/cocoa/WebPlaybackSessionManager.mm:
+        (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
+        (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
+
 2016-04-18  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, rolling out r199644.

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm (199670 => 199671)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm	2016-04-18 15:54:50 UTC (rev 199670)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm	2016-04-18 16:04:07 UTC (rev 199671)
@@ -233,8 +233,9 @@
 void WebPlaybackSessionManager::setUpPlaybackControlsManager(WebCore::HTMLMediaElement& mediaElement)
 {
 #if PLATFORM(MAC)
-    if (m_mediaElements.contains(&mediaElement)) {
-        uint64_t contextId = m_mediaElements.get(&mediaElement);
+    auto foundIterator = m_mediaElements.find(&mediaElement);
+    if (foundIterator != m_mediaElements.end()) {
+        uint64_t contextId = foundIterator->value;
         if (m_controlsManagerContextId == contextId)
             return;
 
@@ -256,11 +257,11 @@
 void WebPlaybackSessionManager::clearPlaybackControlsManager(WebCore::HTMLMediaElement& mediaElement)
 {
 #if PLATFORM(MAC)
-    if (!m_mediaElements.contains(&mediaElement))
+    auto foundIterator = m_mediaElements.find(&mediaElement);
+    if (foundIterator == m_mediaElements.end())
         return;
 
-    uint64_t contextId = m_mediaElements.get(&mediaElement);
-    if (m_controlsManagerContextId != contextId)
+    if (m_controlsManagerContextId != foundIterator->value)
         return;
 
     removeClientForContext(m_controlsManagerContextId);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to