Changeset 187712 in webkit
- Timestamp:
- Jul 31, 2015 11:39:36 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r187709 r187712 1 2015-07-27 Matt Rajca <mrajca@apple.com> 2 3 Media Session: give media elements unique IDs 4 https://bugs.webkit.org/show_bug.cgi?id=147322 5 6 Reviewed by Eric Carlson. 7 8 * html/HTMLMediaElement.cpp: 9 (WebCore::elementIDsToElements): Create a global map of element IDs to elements. 10 (WebCore::HTMLMediaElement::elementWithID): Retrieve the element with the given ID. 11 (WebCore::HTMLMediaElement::HTMLMediaElement): Give the element a unique ID. 12 (WebCore::HTMLMediaElement::playInternal): Removed whitespace. 13 (WebCore::HTMLMediaElement::pauseInternal): Ditto. 14 * html/HTMLMediaElement.h: 15 (WebCore::HTMLMediaElement::elementID): 16 1 17 2015-07-31 Myles C. Maxfield <mmaxfield@apple.com> 2 18 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r187688 r187712 289 289 } 290 290 291 #if ENABLE(MEDIA_SESSION) 292 typedef HashMap<uint64_t, HTMLMediaElement*> IDToElementMap; 293 294 static IDToElementMap& elementIDsToElements() 295 { 296 static NeverDestroyed<IDToElementMap> map; 297 return map; 298 } 299 300 HTMLMediaElement* HTMLMediaElement::elementWithID(uint64_t id) 301 { 302 return elementIDsToElements().get(id); 303 } 304 305 static uint64_t nextElementID() 306 { 307 static uint64_t elementID = 0; 308 return ++elementID; 309 } 310 #endif 311 291 312 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& document, bool createdByParser) 292 313 : HTMLElement(tagName, document) … … 417 438 418 439 #if ENABLE(MEDIA_SESSION) 440 m_elementID = nextElementID(); 441 elementIDsToElements().add(m_elementID, this); 442 419 443 setSessionInternal(document.defaultMediaSession()); 420 444 #endif … … 2854 2878 return; 2855 2879 } 2856 2880 2857 2881 // 4.8.10.9. Playing the media resource 2858 2882 if (!m_player || m_networkState == NETWORK_EMPTY) … … 2920 2944 return; 2921 2945 } 2922 2946 2923 2947 // 4.8.10.9. Playing the media resource 2924 2948 if (!m_player || m_networkState == NETWORK_EMPTY) { -
trunk/Source/WebCore/html/HTMLMediaElement.h
r187655 r187712 430 430 431 431 void setShouldDuck(bool); 432 433 static HTMLMediaElement* elementWithID(uint64_t); 434 uint64_t elementID() const { return m_elementID; } 432 435 #endif 433 436 … … 831 834 RefPtr<MediaSession> m_session; 832 835 bool m_shouldDuck { false }; 836 uint64_t m_elementID; 833 837 #endif 834 838
Note: See TracChangeset
for help on using the changeset viewer.