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

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: Change test data to "const unsigned char" instead of "const char" to fix warnings in windows build Created 4 years, 1 month 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 m_writer ? m_writer->encoding() : emptyAtom, true, 787 m_writer ? m_writer->encoding() : emptyAtom, true,
784 ForceSynchronousParsing); 788 ForceSynchronousParsing);
785 if (!source.isNull()) 789 if (!source.isNull())
786 m_writer->appendReplacingData(source); 790 m_writer->appendReplacingData(source);
787 endWriting(); 791 endWriting();
788 } 792 }
789 793
790 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 794 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
791 795
792 } // namespace blink 796 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698