Title: [269876] branches/safari-610.3.7.1-branch/Source
- Revision
- 269876
- Author
- [email protected]
- Date
- 2020-11-16 13:58:18 -0800 (Mon, 16 Nov 2020)
Log Message
Revert r268979. rdar://problem/71446624
Modified Paths
Diff
Modified: branches/safari-610.3.7.1-branch/Source/WTF/ChangeLog (269875 => 269876)
--- branches/safari-610.3.7.1-branch/Source/WTF/ChangeLog 2020-11-16 21:45:15 UTC (rev 269875)
+++ branches/safari-610.3.7.1-branch/Source/WTF/ChangeLog 2020-11-16 21:58:18 UTC (rev 269876)
@@ -1,44 +1,3 @@
-2020-11-16 Alan Coon <[email protected]>
-
- Cherry-pick r268979. rdar://problem/71446624
-
- Use a WeakHashSet for Document::m_captionPreferencesChangedElements
- https://bugs.webkit.org/show_bug.cgi?id=218170
-
- Reviewed by Eric Carlson.
-
- Source/WebCore:
-
- Refactoring to move from raw pointer to weak pointer.
- For that purpose, we use WeakHashSet and WeakHashSet::forEach for extra safety.
- No observable change of behavior.
-
- * dom/Document.cpp:
- (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
- (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks):
- (WebCore::Document::captionPreferencesChanged):
- * dom/Document.h:
-
- Source/WTF:
-
- * wtf/WeakHashSet.h:
- Add a static cast for classes inheriting CanMakeWeakPtr like done for the set iterator.
- Update code to compile in WinCairo.
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2020-10-26 Youenn Fablet <[email protected]>
-
- Use a WeakHashSet for Document::m_captionPreferencesChangedElements
- https://bugs.webkit.org/show_bug.cgi?id=218170
-
- Reviewed by Eric Carlson.
-
- * wtf/WeakHashSet.h:
- Add a static cast for classes inheriting CanMakeWeakPtr like done for the set iterator.
- Update code to compile in WinCairo.
-
2020-10-27 Russell Epstein <[email protected]>
Apply patch. rdar://problem/70733375
Modified: branches/safari-610.3.7.1-branch/Source/WTF/wtf/WeakHashSet.h (269875 => 269876)
--- branches/safari-610.3.7.1-branch/Source/WTF/wtf/WeakHashSet.h 2020-11-16 21:45:15 UTC (rev 269875)
+++ branches/safari-610.3.7.1-branch/Source/WTF/wtf/WeakHashSet.h 2020-11-16 21:58:18 UTC (rev 269876)
@@ -139,11 +139,7 @@
void forEach(const Function<void(T&)>& callback)
{
- auto items = map(m_set, [](const Ref<WeakPtrImpl<Counter>>& item) {
- auto* pointer = static_cast<T*>(item->template get<T>());
- return makeWeakPtr(pointer);
- });
- for (auto& item : items) {
+ for (auto& item : map(m_set, [](auto& item) { return makeWeakPtr(item->template get<T>()); })) {
if (item && m_set.contains(*item.m_impl))
callback(*item);
}
Modified: branches/safari-610.3.7.1-branch/Source/WebCore/ChangeLog (269875 => 269876)
--- branches/safari-610.3.7.1-branch/Source/WebCore/ChangeLog 2020-11-16 21:45:15 UTC (rev 269875)
+++ branches/safari-610.3.7.1-branch/Source/WebCore/ChangeLog 2020-11-16 21:58:18 UTC (rev 269876)
@@ -1,50 +1,3 @@
-2020-11-16 Alan Coon <[email protected]>
-
- Cherry-pick r268979. rdar://problem/71446624
-
- Use a WeakHashSet for Document::m_captionPreferencesChangedElements
- https://bugs.webkit.org/show_bug.cgi?id=218170
-
- Reviewed by Eric Carlson.
-
- Source/WebCore:
-
- Refactoring to move from raw pointer to weak pointer.
- For that purpose, we use WeakHashSet and WeakHashSet::forEach for extra safety.
- No observable change of behavior.
-
- * dom/Document.cpp:
- (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
- (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks):
- (WebCore::Document::captionPreferencesChanged):
- * dom/Document.h:
-
- Source/WTF:
-
- * wtf/WeakHashSet.h:
- Add a static cast for classes inheriting CanMakeWeakPtr like done for the set iterator.
- Update code to compile in WinCairo.
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2020-10-26 Youenn Fablet <[email protected]>
-
- Use a WeakHashSet for Document::m_captionPreferencesChangedElements
- https://bugs.webkit.org/show_bug.cgi?id=218170
-
- Reviewed by Eric Carlson.
-
- Refactoring to move from raw pointer to weak pointer.
- For that purpose, we use WeakHashSet and WeakHashSet::forEach for extra safety.
- No observable change of behavior.
-
- * dom/Document.cpp:
- (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
- (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks):
- (WebCore::Document::captionPreferencesChanged):
- * dom/Document.h:
-
2020-11-06 Kocsen Chung <[email protected]>
Cherry-pick r269121. rdar://problem/71120565
Modified: branches/safari-610.3.7.1-branch/Source/WebCore/dom/Document.cpp (269875 => 269876)
--- branches/safari-610.3.7.1-branch/Source/WebCore/dom/Document.cpp 2020-11-16 21:45:15 UTC (rev 269875)
+++ branches/safari-610.3.7.1-branch/Source/WebCore/dom/Document.cpp 2020-11-16 21:58:18 UTC (rev 269876)
@@ -5542,20 +5542,18 @@
if (page())
page()->group().captionPreferences().setInterestedInCaptionPreferenceChanges();
- m_captionPreferencesChangedElements.add(element);
+ m_captionPreferencesChangedElements.add(&element);
}
void Document::unregisterForCaptionPreferencesChangedCallbacks(HTMLMediaElement& element)
{
- m_captionPreferencesChangedElements.remove(element);
+ m_captionPreferencesChangedElements.remove(&element);
}
void Document::captionPreferencesChanged()
{
- ASSERT(!m_captionPreferencesChangedElements.hasNullReferences());
- m_captionPreferencesChangedElements.forEach([](HTMLMediaElement& element) {
- element.captionPreferencesChanged();
- });
+ for (auto* element : m_captionPreferencesChangedElements)
+ element->captionPreferencesChanged();
}
void Document::setMediaElementShowingTextTrack(const HTMLMediaElement& element)
Modified: branches/safari-610.3.7.1-branch/Source/WebCore/dom/Document.h (269875 => 269876)
--- branches/safari-610.3.7.1-branch/Source/WebCore/dom/Document.h 2020-11-16 21:45:15 UTC (rev 269875)
+++ branches/safari-610.3.7.1-branch/Source/WebCore/dom/Document.h 2020-11-16 21:58:18 UTC (rev 269876)
@@ -1828,7 +1828,7 @@
#endif
#if ENABLE(VIDEO)
- WeakHashSet<HTMLMediaElement> m_captionPreferencesChangedElements;
+ HashSet<HTMLMediaElement*> m_captionPreferencesChangedElements;
WeakPtr<HTMLMediaElement> m_mediaElementShowingTextTrack;
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes