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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 1829403002: Clean up font loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Resource_status
Patch Set: Created 4 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
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) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
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 * 8 *
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 resource = ImageResource::fetch(request, fetcher()); 172 resource = ImageResource::fetch(request, fetcher());
173 break; 173 break;
174 case Resource::Script: 174 case Resource::Script:
175 resource = ScriptResource::fetch(request, fetcher()); 175 resource = ScriptResource::fetch(request, fetcher());
176 break; 176 break;
177 case Resource::CSSStyleSheet: 177 case Resource::CSSStyleSheet:
178 resource = CSSStyleSheetResource::fetch(request, fetcher()); 178 resource = CSSStyleSheetResource::fetch(request, fetcher());
179 break; 179 break;
180 case Resource::Font: 180 case Resource::Font:
181 resource = FontResource::fetch(request, fetcher()); 181 resource = FontResource::fetch(request, fetcher());
182 // This is needed for fonts as loading doesn't start until there's usage .
183 if (resource)
184 toFontResource(resource)->beginLoadIfNeeded(fetcher());
185 break; 182 break;
186 case Resource::Media: 183 case Resource::Media:
187 resource = RawResource::fetchMedia(request, fetcher()); 184 resource = RawResource::fetchMedia(request, fetcher());
188 break; 185 break;
189 case Resource::TextTrack: 186 case Resource::TextTrack:
190 resource = RawResource::fetchTextTrack(request, fetcher()); 187 resource = RawResource::fetchTextTrack(request, fetcher());
191 break; 188 break;
192 case Resource::ImportResource: 189 case Resource::ImportResource:
193 resource = RawResource::fetchImport(request, fetcher()); 190 resource = RawResource::fetchImport(request, fetcher());
194 break; 191 break;
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 { 681 {
685 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 682 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
686 if (!source.isNull()) 683 if (!source.isNull())
687 m_writer->appendReplacingData(source); 684 m_writer->appendReplacingData(source);
688 endWriting(m_writer.get()); 685 endWriting(m_writer.get());
689 } 686 }
690 687
691 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 688 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
692 689
693 } // namespace blink 690 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698