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

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

Issue 2423683002: Add Blink support for showing image placeholders using range requests. (Closed)
Patch Set: Addressed comments Created 4 years, 2 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 void DocumentLoader::setSubresourceFilter( 156 void DocumentLoader::setSubresourceFilter(
157 std::unique_ptr<WebDocumentSubresourceFilter> subresourceFilter) { 157 std::unique_ptr<WebDocumentSubresourceFilter> subresourceFilter) {
158 m_subresourceFilter = std::move(subresourceFilter); 158 m_subresourceFilter = std::move(subresourceFilter);
159 } 159 }
160 160
161 Resource* DocumentLoader::startPreload(Resource::Type type, 161 Resource* DocumentLoader::startPreload(Resource::Type type,
162 FetchRequest& request) { 162 FetchRequest& request) {
163 Resource* resource = nullptr; 163 Resource* resource = nullptr;
164 switch (type) { 164 switch (type) {
165 case Resource::Image: 165 case Resource::Image:
166 if (m_frame && m_frame->settings() &&
167 m_frame->settings()->fetchImagePlaceholders()) {
168 request.setAllowImagePlaceholder();
169 }
166 resource = ImageResource::fetch(request, fetcher()); 170 resource = ImageResource::fetch(request, fetcher());
167 break; 171 break;
168 case Resource::Script: 172 case Resource::Script:
169 resource = ScriptResource::fetch(request, fetcher()); 173 resource = ScriptResource::fetch(request, fetcher());
170 break; 174 break;
171 case Resource::CSSStyleSheet: 175 case Resource::CSSStyleSheet:
172 resource = CSSStyleSheetResource::fetch(request, fetcher()); 176 resource = CSSStyleSheetResource::fetch(request, fetcher());
173 break; 177 break;
174 case Resource::Font: 178 case Resource::Font:
175 resource = FontResource::fetch(request, fetcher()); 179 resource = FontResource::fetch(request, fetcher());
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 m_writer ? m_writer->encoding() : emptyAtom, true, 788 m_writer ? m_writer->encoding() : emptyAtom, true,
785 ForceSynchronousParsing); 789 ForceSynchronousParsing);
786 if (!source.isNull()) 790 if (!source.isNull())
787 m_writer->appendReplacingData(source); 791 m_writer->appendReplacingData(source);
788 endWriting(m_writer.get()); 792 endWriting(m_writer.get());
789 } 793 }
790 794
791 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 795 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
792 796
793 } // namespace blink 797 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698