| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
| 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void CSSPreloadScanner::setReferrerPolicy(const ReferrerPolicy policy) { | 93 void CSSPreloadScanner::setReferrerPolicy(const ReferrerPolicy policy) { |
| 94 m_referrerPolicy = policy; | 94 m_referrerPolicy = policy; |
| 95 } | 95 } |
| 96 | 96 |
| 97 inline void CSSPreloadScanner::tokenize(UChar c, | 97 inline void CSSPreloadScanner::tokenize(UChar c, |
| 98 const SegmentedString& source) { | 98 const SegmentedString& source) { |
| 99 // We are just interested in @import rules, no need for real tokenization here | 99 // We are just interested in @import rules, no need for real tokenization here |
| 100 // Searching for other types of resources is probably low payoff. | 100 // Searching for other types of resources is probably low payoff. |
| 101 // If we ever decide to preload fonts, we also need to change |
| 102 // ResourceFetcher::resourceNeedsLoad to immediately load speculative font |
| 103 // preloads. |
| 101 switch (m_state) { | 104 switch (m_state) { |
| 102 case Initial: | 105 case Initial: |
| 103 if (isHTMLSpace<UChar>(c)) | 106 if (isHTMLSpace<UChar>(c)) |
| 104 break; | 107 break; |
| 105 if (c == '@') | 108 if (c == '@') |
| 106 m_state = RuleStart; | 109 m_state = RuleStart; |
| 107 else if (c == '/') | 110 else if (c == '/') |
| 108 m_state = MaybeComment; | 111 m_state = MaybeComment; |
| 109 else | 112 else |
| 110 m_state = DoneParsingImportRules; | 113 m_state = DoneParsingImportRules; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 m_resource.clear(); | 346 m_resource.clear(); |
| 344 } | 347 } |
| 345 | 348 |
| 346 DEFINE_TRACE(CSSPreloaderResourceClient) { | 349 DEFINE_TRACE(CSSPreloaderResourceClient) { |
| 347 visitor->trace(m_preloader); | 350 visitor->trace(m_preloader); |
| 348 visitor->trace(m_resource); | 351 visitor->trace(m_resource); |
| 349 StyleSheetResourceClient::trace(visitor); | 352 StyleSheetResourceClient::trace(visitor); |
| 350 } | 353 } |
| 351 | 354 |
| 352 } // namespace blink | 355 } // namespace blink |
| OLD | NEW |