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

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

Issue 645743003: Use C++11 range-based loop for core/css (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: better variable names Created 6 years, 2 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/MediaQueryMatcher.cpp ('k') | Source/core/css/RuleSet.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/RemoteFontFaceSource.h" 6 #include "core/css/RemoteFontFaceSource.h"
7 7
8 #include "core/css/CSSCustomFontData.h" 8 #include "core/css/CSSCustomFontData.h"
9 #include "core/css/CSSFontFace.h" 9 #include "core/css/CSSFontFace.h"
10 #include "core/css/FontLoader.h" 10 #include "core/css/FontLoader.h"
(...skipping 16 matching lines...) Expand all
27 { 27 {
28 m_font->removeClient(this); 28 m_font->removeClient(this);
29 pruneTable(); 29 pruneTable();
30 } 30 }
31 31
32 void RemoteFontFaceSource::pruneTable() 32 void RemoteFontFaceSource::pruneTable()
33 { 33 {
34 if (m_fontDataTable.isEmpty()) 34 if (m_fontDataTable.isEmpty())
35 return; 35 return;
36 36
37 for (FontDataTable::iterator it = m_fontDataTable.begin(); it != m_fontDataT able.end(); ++it) { 37 for (const auto& item : m_fontDataTable) {
38 SimpleFontData* fontData = it->value.get(); 38 SimpleFontData* fontData = item.value.get();
39 if (fontData && fontData->customFontData()) 39 if (fontData && fontData->customFontData())
40 fontData->customFontData()->clearFontFaceSource(); 40 fontData->customFontData()->clearFontFaceSource();
41 } 41 }
42 m_fontDataTable.clear(); 42 m_fontDataTable.clear();
43 } 43 }
44 44
45 bool RemoteFontFaceSource::isLoading() const 45 bool RemoteFontFaceSource::isLoading() const
46 { 46 {
47 return !m_font->stillNeedsLoad() && !m_font->isLoaded(); 47 return !m_font->stillNeedsLoad() && !m_font->isLoaded();
48 } 48 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (size < 50 * 1024) 188 if (size < 50 * 1024)
189 return "WebFont.DownloadTime.1.10KBTo50KB"; 189 return "WebFont.DownloadTime.1.10KBTo50KB";
190 if (size < 100 * 1024) 190 if (size < 100 * 1024)
191 return "WebFont.DownloadTime.2.50KBTo100KB"; 191 return "WebFont.DownloadTime.2.50KBTo100KB";
192 if (size < 1024 * 1024) 192 if (size < 1024 * 1024)
193 return "WebFont.DownloadTime.3.100KBTo1MB"; 193 return "WebFont.DownloadTime.3.100KBTo1MB";
194 return "WebFont.DownloadTime.4.Over1MB"; 194 return "WebFont.DownloadTime.4.Over1MB";
195 } 195 }
196 196
197 } // namespace blink 197 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryMatcher.cpp ('k') | Source/core/css/RuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698