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

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

Issue 2329243002: Implement WTF::WeakPtr in terms of base::WeakPtr (Closed)
Patch Set: Thread-safety fix with comment Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 void FontFallbackList::releaseFontData() 68 void FontFallbackList::releaseFontData()
69 { 69 {
70 unsigned numFonts = m_fontList.size(); 70 unsigned numFonts = m_fontList.size();
71 for (unsigned i = 0; i < numFonts; ++i) { 71 for (unsigned i = 0; i < numFonts; ++i) {
72 if (!m_fontList[i]->isCustomFont()) { 72 if (!m_fontList[i]->isCustomFont()) {
73 ASSERT(!m_fontList[i]->isSegmented()); 73 ASSERT(!m_fontList[i]->isSegmented());
74 FontCache::fontCache()->releaseFontData(toSimpleFontData(m_fontList[ i])); 74 FontCache::fontCache()->releaseFontData(toSimpleFontData(m_fontList[ i]));
75 } 75 }
76 } 76 }
77 m_shapeCache.clear(); // Clear the weak pointer to the cache instance. 77 m_shapeCache.reset(); // Clear the weak pointer to the cache instance.
78 } 78 }
79 79
80 bool FontFallbackList::loadingCustomFonts() const 80 bool FontFallbackList::loadingCustomFonts() const
81 { 81 {
82 if (!m_hasLoadingFallback) 82 if (!m_hasLoadingFallback)
83 return false; 83 return false;
84 84
85 unsigned numFonts = m_fontList.size(); 85 unsigned numFonts = m_fontList.size();
86 for (unsigned i = 0; i < numFonts; ++i) { 86 for (unsigned i = 0; i < numFonts; ++i) {
87 if (m_fontList[i]->isLoading()) 87 if (m_fontList[i]->isLoading())
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 bool FontFallbackList::isValid() const 235 bool FontFallbackList::isValid() const
236 { 236 {
237 if (!m_fontSelector) 237 if (!m_fontSelector)
238 return m_fontSelectorVersion == 0; 238 return m_fontSelectorVersion == 0;
239 239
240 return m_fontSelector->version() == m_fontSelectorVersion; 240 return m_fontSelector->version() == m_fontSelectorVersion;
241 } 241 }
242 242
243 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698