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

Side by Side Diff: Source/core/css/FontFaceCache.cpp

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/FontFace.cpp ('k') | Source/core/css/MediaQueryEvaluator.cpp » ('j') | 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) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
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 * 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 void FontFaceCache::addFontFace(CSSFontSelector* cssFontSelector, PassRefPtr<Fon tFace> prpFontFace, bool cssConnected) 57 void FontFaceCache::addFontFace(CSSFontSelector* cssFontSelector, PassRefPtr<Fon tFace> prpFontFace, bool cssConnected)
58 { 58 {
59 RefPtr<FontFace> fontFace = prpFontFace; 59 RefPtr<FontFace> fontFace = prpFontFace;
60 60
61 OwnPtr<TraitsMap>& familyFontFaces = m_fontFaces.add(fontFace->family(), nul lptr).storedValue->value; 61 OwnPtr<TraitsMap>& familyFontFaces = m_fontFaces.add(fontFace->family(), nul lptr).storedValue->value;
62 if (!familyFontFaces) 62 if (!familyFontFaces)
63 familyFontFaces = adoptPtr(new TraitsMap); 63 familyFontFaces = adoptPtr(new TraitsMap);
64 64
65 RefPtr<CSSSegmentedFontFace>& segmentedFontFace = familyFontFaces->add(fontF ace->traitsMask(), 0).storedValue->value; 65 RefPtr<CSSSegmentedFontFace>& segmentedFontFace = familyFontFaces->add(fontF ace->traitsMask(), nullptr).storedValue->value;
66 if (!segmentedFontFace) 66 if (!segmentedFontFace)
67 segmentedFontFace = CSSSegmentedFontFace::create(cssFontSelector, static _cast<FontTraitsMask>(fontFace->traitsMask())); 67 segmentedFontFace = CSSSegmentedFontFace::create(cssFontSelector, static _cast<FontTraitsMask>(fontFace->traitsMask()));
68 68
69 segmentedFontFace->addFontFace(fontFace, cssConnected); 69 segmentedFontFace->addFontFace(fontFace, cssConnected);
70 if (cssConnected) 70 if (cssConnected)
71 m_cssConnectedFontFaces.add(fontFace); 71 m_cssConnectedFontFaces.add(fontFace);
72 72
73 ++m_version; 73 ++m_version;
74 } 74 }
75 75
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 TraitsMap* familyFontFaces = m_fontFaces.get(family); 199 TraitsMap* familyFontFaces = m_fontFaces.get(family);
200 if (!familyFontFaces || familyFontFaces->isEmpty()) 200 if (!familyFontFaces || familyFontFaces->isEmpty())
201 return 0; 201 return 0;
202 202
203 OwnPtr<TraitsMap>& segmentedFontFaceCache = m_fonts.add(family, nullptr).sto redValue->value; 203 OwnPtr<TraitsMap>& segmentedFontFaceCache = m_fonts.add(family, nullptr).sto redValue->value;
204 if (!segmentedFontFaceCache) 204 if (!segmentedFontFaceCache)
205 segmentedFontFaceCache = adoptPtr(new TraitsMap); 205 segmentedFontFaceCache = adoptPtr(new TraitsMap);
206 206
207 FontTraitsMask traitsMask = fontDescription.traitsMask(); 207 FontTraitsMask traitsMask = fontDescription.traitsMask();
208 208
209 RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traitsMask, 0).storedValue->value; 209 RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traitsMask, nullptr).storedValue->value;
210 if (!face) { 210 if (!face) {
211 for (TraitsMap::const_iterator i = familyFontFaces->begin(); i != family FontFaces->end(); ++i) { 211 for (TraitsMap::const_iterator i = familyFontFaces->begin(); i != family FontFaces->end(); ++i) {
212 CSSSegmentedFontFace* candidate = i->value.get(); 212 CSSSegmentedFontFace* candidate = i->value.get();
213 unsigned candidateTraitsMask = candidate->traitsMask(); 213 unsigned candidateTraitsMask = candidate->traitsMask();
214 if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & Fo ntStyleNormalMask)) 214 if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & Fo ntStyleNormalMask))
215 continue; 215 continue;
216 if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask)) 216 if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
217 continue; 217 continue;
218 if (!face || compareFontFaces(candidate, face.get(), traitsMask)) 218 if (!face || compareFontFaces(candidate, face.get(), traitsMask))
219 face = candidate; 219 face = candidate;
220 } 220 }
221 } 221 }
222 return face.get(); 222 return face.get();
223 } 223 }
224 224
225 } 225 }
OLDNEW
« no previous file with comments | « Source/core/css/FontFace.cpp ('k') | Source/core/css/MediaQueryEvaluator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698