Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 2783483003: Revert of Skip nullptr after copyToVector() from HeapHashSet<WeakMember> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontSelector.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 444
445 if (gFontPlatformDataCache) { 445 if (gFontPlatformDataCache) {
446 delete gFontPlatformDataCache; 446 delete gFontPlatformDataCache;
447 gFontPlatformDataCache = new FontPlatformDataCache; 447 gFontPlatformDataCache = new FontPlatformDataCache;
448 } 448 }
449 449
450 gGeneration++; 450 gGeneration++;
451 451
452 HeapVector<Member<FontCacheClient>> clients; 452 HeapVector<Member<FontCacheClient>> clients;
453 copyToVector(fontCacheClients(), clients); 453 copyToVector(fontCacheClients(), clients);
454 for (const auto& client : clients) { 454 for (const auto& client : clients)
455 // This should not be nullptr, but to see if checking nullptr can suppress 455 client->fontCacheInvalidated();
456 // crashes. crbug.com/581698
457 if (client)
458 client->fontCacheInvalidated();
459 }
460 456
461 purge(ForcePurge); 457 purge(ForcePurge);
462 } 458 }
463 459
464 void FontCache::crashWithFontInfo(const FontDescription* fontDescription) { 460 void FontCache::crashWithFontInfo(const FontDescription* fontDescription) {
465 FontCache* fontCache = FontCache::fontCache(); 461 FontCache* fontCache = FontCache::fontCache();
466 SkFontMgr* fontMgr = nullptr; 462 SkFontMgr* fontMgr = nullptr;
467 int numFamilies = std::numeric_limits<int>::min(); 463 int numFamilies = std::numeric_limits<int>::min();
468 if (fontCache) { 464 if (fontCache) {
469 fontMgr = fontCache->m_fontManager.get(); 465 fontMgr = fontCache->m_fontManager.get();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 for (iter = gFallbackListShaperCache->begin(); 502 for (iter = gFallbackListShaperCache->begin();
507 iter != gFallbackListShaperCache->end(); ++iter) { 503 iter != gFallbackListShaperCache->end(); ++iter) {
508 shapeResultCacheSize += iter->value->byteSize(); 504 shapeResultCacheSize += iter->value->byteSize();
509 } 505 }
510 dump->AddScalar("size", "bytes", shapeResultCacheSize); 506 dump->AddScalar("size", "bytes", shapeResultCacheSize);
511 memoryDump->AddSuballocation(dump->guid(), 507 memoryDump->AddSuballocation(dump->guid(),
512 WTF::Partitions::kAllocatedObjectPoolName); 508 WTF::Partitions::kAllocatedObjectPoolName);
513 } 509 }
514 510
515 } // namespace blink 511 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontSelector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698