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

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

Issue 2795173002: Do not show image placeholders for CSS sprites (Closed)
Patch Set: rebased and addressed comments Created 3 years, 6 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 const KURL& DocumentLoader::Url() const { 185 const KURL& DocumentLoader::Url() const {
186 return request_.Url(); 186 return request_.Url();
187 } 187 }
188 188
189 Resource* DocumentLoader::StartPreload(Resource::Type type, 189 Resource* DocumentLoader::StartPreload(Resource::Type type,
190 FetchParameters& params) { 190 FetchParameters& params) {
191 Resource* resource = nullptr; 191 Resource* resource = nullptr;
192 switch (type) { 192 switch (type) {
193 case Resource::kImage: 193 case Resource::kImage:
194 if (frame_) 194 if (frame_ && frame_->GetSettings() &&
195 frame_->GetSettings()->GetFetchImagePlaceholders()) {
sclittle 2017/06/13 00:28:27 Could you remove the Settings checks here? They're
rajendrant 2017/06/21 19:00:58 Done.
195 frame_->MaybeAllowImagePlaceholder(params); 196 frame_->MaybeAllowImagePlaceholder(params);
197 }
196 resource = ImageResource::Fetch(params, Fetcher()); 198 resource = ImageResource::Fetch(params, Fetcher());
197 break; 199 break;
198 case Resource::kScript: 200 case Resource::kScript:
199 resource = ScriptResource::Fetch(params, Fetcher()); 201 resource = ScriptResource::Fetch(params, Fetcher());
200 break; 202 break;
201 case Resource::kCSSStyleSheet: 203 case Resource::kCSSStyleSheet:
202 resource = CSSStyleSheetResource::Fetch(params, Fetcher()); 204 resource = CSSStyleSheetResource::Fetch(params, Fetcher());
203 break; 205 break;
204 case Resource::kFont: 206 case Resource::kFont:
205 resource = FontResource::Fetch(params, Fetcher()); 207 resource = FontResource::Fetch(params, Fetcher());
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 InstallNewDocumentReason::kJavascriptURL, 1093 InstallNewDocumentReason::kJavascriptURL,
1092 kForceSynchronousParsing, KURL()); 1094 kForceSynchronousParsing, KURL());
1093 if (!source.IsNull()) 1095 if (!source.IsNull())
1094 writer_->AppendReplacingData(source); 1096 writer_->AppendReplacingData(source);
1095 EndWriting(); 1097 EndWriting();
1096 } 1098 }
1097 1099
1098 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 1100 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
1099 1101
1100 } // namespace blink 1102 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698