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

Side by Side Diff: Source/core/fetch/FontResource.cpp

Issue 201403002: Use new is*Element() helper functions more in core/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/events/EventPath.cpp ('k') | Source/core/frame/FrameView.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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. 3 * Copyright (C) 2009 Torch Mobile, Inc.
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (!collection) 136 if (!collection)
137 return 0; 137 return 0;
138 138
139 unsigned collectionLength = collection->length(); 139 unsigned collectionLength = collection->length();
140 if (!collectionLength) 140 if (!collectionLength)
141 return 0; 141 return 0;
142 142
143 #ifndef NDEBUG 143 #ifndef NDEBUG
144 for (unsigned i = 0; i < collectionLength; ++i) { 144 for (unsigned i = 0; i < collectionLength; ++i) {
145 ASSERT(collection->item(i)); 145 ASSERT(collection->item(i));
146 ASSERT(collection->item(i)->hasTagName(SVGNames::fontTag)); 146 ASSERT(isSVGFontElement(collection->item(i)));
147 } 147 }
148 #endif 148 #endif
149 149
150 if (fontName.isEmpty()) 150 if (fontName.isEmpty())
151 return toSVGFontElement(collection->item(0)); 151 return toSVGFontElement(collection->item(0));
152 152
153 for (unsigned i = 0; i < collectionLength; ++i) { 153 for (unsigned i = 0; i < collectionLength; ++i) {
154 SVGFontElement* element = toSVGFontElement(collection->item(i)); 154 SVGFontElement* element = toSVGFontElement(collection->item(i));
155 if (element->getIdAttribute() == fontName) 155 if (element->getIdAttribute() == fontName)
156 return element; 156 return element;
(...skipping 26 matching lines...) Expand all
183 183
184 void FontResource::checkNotify() 184 void FontResource::checkNotify()
185 { 185 {
186 m_fontLoadWaitLimitTimer.stop(); 186 m_fontLoadWaitLimitTimer.stop();
187 ResourceClientWalker<FontResourceClient> w(m_clients); 187 ResourceClientWalker<FontResourceClient> w(m_clients);
188 while (FontResourceClient* c = w.next()) 188 while (FontResourceClient* c = w.next())
189 c->fontLoaded(this); 189 c->fontLoaded(this);
190 } 190 }
191 191
192 } 192 }
OLDNEW
« no previous file with comments | « Source/core/events/EventPath.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698