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

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

Issue 2724753002: Check not to insert nullptr to HeapHashSet<WeakMember> (Closed)
Patch Set: Created 3 years, 9 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 static bool invalidateFontCache = false; 419 static bool invalidateFontCache = false;
420 420
421 HeapHashSet<WeakMember<FontCacheClient>>& fontCacheClients() { 421 HeapHashSet<WeakMember<FontCacheClient>>& fontCacheClients() {
422 DEFINE_STATIC_LOCAL(HeapHashSet<WeakMember<FontCacheClient>>, clients, 422 DEFINE_STATIC_LOCAL(HeapHashSet<WeakMember<FontCacheClient>>, clients,
423 (new HeapHashSet<WeakMember<FontCacheClient>>)); 423 (new HeapHashSet<WeakMember<FontCacheClient>>));
424 invalidateFontCache = true; 424 invalidateFontCache = true;
425 return clients; 425 return clients;
426 } 426 }
427 427
428 void FontCache::addClient(FontCacheClient* client) { 428 void FontCache::addClient(FontCacheClient* client) {
429 CHECK(client);
429 ASSERT(!fontCacheClients().contains(client)); 430 ASSERT(!fontCacheClients().contains(client));
430 fontCacheClients().insert(client); 431 fontCacheClients().insert(client);
431 } 432 }
432 433
433 static unsigned short gGeneration = 0; 434 static unsigned short gGeneration = 0;
434 435
435 unsigned short FontCache::generation() { 436 unsigned short FontCache::generation() {
436 return gGeneration; 437 return gGeneration;
437 } 438 }
438 439
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 for (iter = gFallbackListShaperCache->begin(); 503 for (iter = gFallbackListShaperCache->begin();
503 iter != gFallbackListShaperCache->end(); ++iter) { 504 iter != gFallbackListShaperCache->end(); ++iter) {
504 shapeResultCacheSize += iter->value->byteSize(); 505 shapeResultCacheSize += iter->value->byteSize();
505 } 506 }
506 dump->AddScalar("size", "bytes", shapeResultCacheSize); 507 dump->AddScalar("size", "bytes", shapeResultCacheSize);
507 memoryDump->AddSuballocation(dump->guid(), 508 memoryDump->AddSuballocation(dump->guid(),
508 WTF::Partitions::kAllocatedObjectPoolName); 509 WTF::Partitions::kAllocatedObjectPoolName);
509 } 510 }
510 511
511 } // namespace blink 512 } // 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