| OLD | NEW |
| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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
. | 182 // This is needed for fonts as loading doesn't start until there's usage
. |
| 183 toFontResource(resource)->beginLoadIfNeeded(fetcher()); | 183 if (resource) |
| 184 toFontResource(resource)->beginLoadIfNeeded(fetcher()); |
| 184 break; | 185 break; |
| 185 case Resource::Media: | 186 case Resource::Media: |
| 186 resource = RawResource::fetchMedia(request, fetcher()); | 187 resource = RawResource::fetchMedia(request, fetcher()); |
| 187 break; | 188 break; |
| 188 case Resource::TextTrack: | 189 case Resource::TextTrack: |
| 189 resource = RawResource::fetchTextTrack(request, fetcher()); | 190 resource = RawResource::fetchTextTrack(request, fetcher()); |
| 190 break; | 191 break; |
| 191 case Resource::ImportResource: | 192 case Resource::ImportResource: |
| 192 resource = RawResource::fetchImport(request, fetcher()); | 193 resource = RawResource::fetchImport(request, fetcher()); |
| 193 break; | 194 break; |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 { | 688 { |
| 688 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); | 689 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); |
| 689 if (!source.isNull()) | 690 if (!source.isNull()) |
| 690 m_writer->appendReplacingData(source); | 691 m_writer->appendReplacingData(source); |
| 691 endWriting(m_writer.get()); | 692 endWriting(m_writer.get()); |
| 692 } | 693 } |
| 693 | 694 |
| 694 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 695 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 695 | 696 |
| 696 } // namespace blink | 697 } // namespace blink |
| OLD | NEW |