Changeset 263285 in webkit
- Timestamp:
- Jun 19, 2020, 2:03:35 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/accessibility/AXObjectCache.cpp (modified) (3 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r263282 r263285 1 2020-06-19 Andres Gonzalez <andresg_22@apple.com> 2 3 AX: web process crash in AXObjectCache::postNotification. 4 https://bugs.webkit.org/show_bug.cgi?id=213398 5 6 Reviewed by Chris Fleizach. 7 8 AXObjectCache was being instantiated on the AX secondary thread. 9 Therefore the timers for the different delayed notifications where 10 initialized with the secondary thread. When postNotification was triggered 11 on the main thread as it should, and the timer was accessed, the timer 12 would assert/crash for being accessed in a thread different than where 13 it was created. This change guaranties that AXObjectCache is always 14 created on the main thread. 15 16 * accessibility/AXObjectCache.cpp: 17 (WebCore::AXObjectCache::enableAccessibility): 18 (WebCore::AXObjectCache::AXObjectCache): 19 (WebCore::AXObjectCache::postNotification): 20 1 21 2020-06-19 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r262073 r263285 196 196 void AXObjectCache::enableAccessibility() 197 197 { 198 ASSERT(isMainThread()); 198 199 gAccessibilityEnabled = true; 199 200 } … … 223 224 , m_performCacheUpdateTimer(*this, &AXObjectCache::performCacheUpdateTimerFired) 224 225 { 226 ASSERT(isMainThread()); 225 227 } 226 228 … … 1130 1132 AXTRACE("AXObjectCache::postNotification"); 1131 1133 AXLOG(std::make_pair(object, notification)); 1134 ASSERT(isMainThread()); 1132 1135 1133 1136 stopCachingComputedObjectAttributes(); -
trunk/Source/WebKit/ChangeLog
r263275 r263285 1 2020-06-19 Andres Gonzalez <andresg_22@apple.com> 2 3 AX: web process crash in AXObjectCache::postNotification. 4 https://bugs.webkit.org/show_bug.cgi?id=213398 5 6 Reviewed by Chris Fleizach. 7 8 AXObjectCache was being instantiated on the AX secondary thread. 9 Therefore the timers for the different delayed notifications where 10 initialized with the secondary thread. When postNotification was triggered 11 on the main thread as it should, and the timer was accessed, the timer 12 would assert/crash for being accessed in a thread different than where 13 it was created. This change guaranties that AXObjectCache is always 14 created on the main thread. 15 16 * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: 17 (-[WKAccessibilityWebPageObjectBase axObjectCache]): 18 (-[WKAccessibilityWebPageObjectBase accessibilityPluginObject]): 19 (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): 20 (-[WKAccessibilityWebPageObjectBase setWebPage:]): 21 (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]): 22 (-[WKAccessibilityWebPageObjectBase setRemoteParent:]): 23 1 24 2020-06-19 Chris Fleizach <cfleizach@apple.com> 2 25 -
trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm
r259843 r263285 43 43 #import <WebCore/Scrollbar.h> 44 44 45 namespace ax = WebCore::Accessibility; 46 45 47 @implementation WKAccessibilityWebPageObjectBase 46 48 47 49 - (NakedPtr<WebCore::AXObjectCache>)axObjectCache 48 50 { 51 ASSERT(isMainThread()); 52 49 53 if (!m_page) 50 54 return nullptr; … … 63 67 - (id)accessibilityPluginObject 64 68 { 69 ASSERT(isMainThread()); 65 70 auto retrieveBlock = [&self]() -> id { 66 71 id axPlugin = nil; … … 85 90 - (id)accessibilityRootObjectWrapper 86 91 { 87 if (!WebCore::AXObjectCache::accessibilityEnabled()) 88 WebCore::AXObjectCache::enableAccessibility(); 92 return ax::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 93 if (!WebCore::AXObjectCache::accessibilityEnabled()) 94 WebCore::AXObjectCache::enableAccessibility(); 89 95 90 if (m_hasMainFramePlugin)91 return self.accessibilityPluginObject;96 if (protectedSelf.get()->m_hasMainFramePlugin) 97 return protectedSelf.get().accessibilityPluginObject; 92 98 93 if (auto cache = [self axObjectCache]) {94 if (WebCore::AXCoreObject* root = cache->rootObject())95 return root->wrapper();96 }99 if (auto cache = protectedSelf.get().axObjectCache) { 100 if (auto* root = cache->rootObject()) 101 return root->wrapper(); 102 } 97 103 98 return nil; 104 return nil; 105 }); 99 106 } 100 107 101 108 - (void)setWebPage:(NakedPtr<WebKit::WebPage>)page 102 109 { 110 ASSERT(isMainThread()); 111 103 112 m_page = page; 104 113 … … 116 125 - (void)setHasMainFramePlugin:(bool)hasPlugin 117 126 { 127 ASSERT(isMainThread()); 118 128 m_hasMainFramePlugin = hasPlugin; 119 129 } … … 121 131 - (void)setRemoteParent:(id)parent 122 132 { 133 ASSERT(isMainThread()); 123 134 if (parent != m_parent) { 124 135 [m_parent release]; … … 132 143 } 133 144 134 135 145 @end
Note:
See TracChangeset
for help on using the changeset viewer.