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

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

Issue 230383003: Webfont CORS-enabled fetching with fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & reverse the enum values Created 6 years, 8 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 | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSFontFaceSrcValue.h » ('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 * 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 source->setFontFace(this); 42 source->setFontFace(this);
43 m_sources.append(source); 43 m_sources.append(source);
44 } 44 }
45 45
46 void CSSFontFace::setSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace) 46 void CSSFontFace::setSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)
47 { 47 {
48 ASSERT(!m_segmentedFontFace); 48 ASSERT(!m_segmentedFontFace);
49 m_segmentedFontFace = segmentedFontFace; 49 m_segmentedFontFace = segmentedFontFace;
50 } 50 }
51 51
52 CSSFontSelector* CSSFontFace::fontSelector() const
53 {
54 return m_segmentedFontFace ? m_segmentedFontFace->fontSelector() : 0;
55 }
56
52 void CSSFontFace::beginLoadIfNeeded(CSSFontFaceSource* source, CSSFontSelector* fontSelector) 57 void CSSFontFace::beginLoadIfNeeded(CSSFontFaceSource* source, CSSFontSelector* fontSelector)
53 { 58 {
54 if (source->resource() && source->resource()->stillNeedsLoad()) { 59 if (source->resource() && source->resource()->stillNeedsLoad()) {
55 if (!fontSelector) { 60 if (!fontSelector) {
56 if (!m_segmentedFontFace) 61 if (!m_segmentedFontFace)
57 return; 62 return;
58 fontSelector = m_segmentedFontFace->fontSelector(); 63 fontSelector = m_segmentedFontFace->fontSelector();
59 } 64 }
60 fontSelector->beginLoadingFontSoon(source->resource()); 65 fontSelector->beginLoadingFontSoon(source->resource());
61 } 66 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 UChar32 c = text.characterStartingAt(index); 231 UChar32 c = text.characterStartingAt(index);
227 index += U16_LENGTH(c); 232 index += U16_LENGTH(c);
228 Vector<UnicodeRange>::const_iterator it = std::lower_bound(m_ranges.begi n(), m_ranges.end(), c); 233 Vector<UnicodeRange>::const_iterator it = std::lower_bound(m_ranges.begi n(), m_ranges.end(), c);
229 if (it != m_ranges.end() && it->contains(c)) 234 if (it != m_ranges.end() && it->contains(c))
230 return true; 235 return true;
231 } 236 }
232 return false; 237 return false;
233 } 238 }
234 239
235 } 240 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSFontFaceSrcValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698