Changeset 87462 in webkit
- Timestamp:
- May 26, 2011, 7:16:21 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/mac/FontCacheMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87460 r87462 1 2011-05-26 David Levin <levin@chromium.org> 2 3 Reviewed by Dmitry Titov. 4 5 WebKit's font notification has problems when the WebKit main thread != UI thread. 6 https://bugs.webkit.org/show_bug.cgi?id=61391 7 8 This doesn't happen in DumpRenderTree, so it needs a unit test which is taking me 9 some time to write correctly. In the meantime, this issues happens to be causing 10 some crashes in Chrome so here's the fix alone for the time being. 11 12 * platform/graphics/mac/FontCacheMac.mm: 13 (WebCore::invalidateFontCache): Ensure that FontCache::invalidate is only called on WebKit's main thread. 14 (WebCore::fontCacheRegisteredFontsChangedNotificationCallback): Call common function for font cache invalidation. 15 Note that the call to fontCache() is fine since the singleton is initialized well before calling this function. Theoretically, 16 there could be a problem due to a lack of a memory barrier but that is highly unlikely and this is debug only code. 17 (WebCore::fontCacheATSNotificationCallback): Ditto. 18 1 19 2011-05-26 Stephanie Lewis <slewis@apple.com> 2 20 -
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
r85036 r87462 37 37 #import "WebFontCache.h" 38 38 #import <AppKit/AppKit.h> 39 #import <wtf/MainThread.h> 39 40 #import <wtf/StdLibExtras.h> 40 41 41 42 42 43 namespace WebCore { 44 45 // The "void*" parameter makes the function match the prototype for callbacks from callOnMainThread. 46 static void invalidateFontCache(void*) 47 { 48 if (!isMainThread()) { 49 callOnMainThread(&invalidateFontCache, 0); 50 return; 51 } 52 fontCache()->invalidate(); 53 } 43 54 44 55 #if !defined(BUILDING_ON_LEOPARD) … … 47 58 ASSERT_UNUSED(observer, observer == fontCache()); 48 59 ASSERT_UNUSED(name, CFEqual(name, kCTFontManagerRegisteredFontsChangedNotification)); 49 fontCache()->invalidate();60 invalidateFontCache(0); 50 61 } 51 62 #else 52 63 static void fontCacheATSNotificationCallback(ATSFontNotificationInfoRef, void*) 53 64 { 54 fontCache()->invalidate();65 invalidateFontCache(0); 55 66 } 56 67 #endif
Note:
See TracChangeset
for help on using the changeset viewer.