Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 } | 85 } |
| 86 | 86 |
| 87 void CSSSegmentedFontFace::addFontFace(PassRefPtr<FontFace> prpFontFace, bool cs sConnected) | 87 void CSSSegmentedFontFace::addFontFace(PassRefPtr<FontFace> prpFontFace, bool cs sConnected) |
| 88 { | 88 { |
| 89 RefPtr<FontFace> fontFace = prpFontFace; | 89 RefPtr<FontFace> fontFace = prpFontFace; |
| 90 pruneTable(); | 90 pruneTable(); |
| 91 fontFace->cssFontFace()->setSegmentedFontFace(this); | 91 fontFace->cssFontFace()->setSegmentedFontFace(this); |
| 92 if (cssConnected) { | 92 if (cssConnected) { |
| 93 m_fontFaces.insertBefore(m_firstNonCssConnectedFace, fontFace); | 93 m_fontFaces.insertBefore(m_firstNonCssConnectedFace, fontFace); |
| 94 } else { | 94 } else { |
| 95 FontFaceList::AddResult result = m_fontFaces.add(fontFace); | 95 m_fontFaces.add(fontFace); |
| 96 if (m_firstNonCssConnectedFace == m_fontFaces.end()) | 96 if (m_firstNonCssConnectedFace == m_fontFaces.end()) |
| 97 m_firstNonCssConnectedFace = result.iterator; | 97 m_firstNonCssConnectedFace = m_fontFaces.find(fontFace); |
|
Inactive
2014/02/04 14:21:33
So for the cases where the caller of add() expects
adamk
2014/02/04 16:29:34
This is my objection, too. Many uses of add() are
| |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 void CSSSegmentedFontFace::removeFontFace(PassRefPtr<FontFace> prpFontFace) | 101 void CSSSegmentedFontFace::removeFontFace(PassRefPtr<FontFace> prpFontFace) |
| 102 { | 102 { |
| 103 RefPtr<FontFace> fontFace = prpFontFace; | 103 RefPtr<FontFace> fontFace = prpFontFace; |
| 104 FontFaceList::iterator it = m_fontFaces.find(fontFace); | 104 FontFaceList::iterator it = m_fontFaces.find(fontFace); |
| 105 if (it == m_fontFaces.end()) | 105 if (it == m_fontFaces.end()) |
| 106 return; | 106 return; |
| 107 | 107 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 { | 221 { |
| 222 Vector<RefPtr<FontFace> > fontFaces; | 222 Vector<RefPtr<FontFace> > fontFaces; |
| 223 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { | 223 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { |
| 224 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) | 224 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) |
| 225 fontFaces.append(*it); | 225 fontFaces.append(*it); |
| 226 } | 226 } |
| 227 return fontFaces; | 227 return fontFaces; |
| 228 } | 228 } |
| 229 | 229 |
| 230 } | 230 } |
| OLD | NEW |