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

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

Issue 2710113002: DO NOT SUBMIT really old prototype of sprite recognition for image replacement
Patch Set: Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 285 }
286 286
287 if (referrerPolicy != ReferrerPolicyDefault) 287 if (referrerPolicy != ReferrerPolicyDefault)
288 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref errerPolicy, url, document.outgoingReferrer())); 288 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref errerPolicy, url, document.outgoingReferrer()));
289 289
290 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) 290 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull())
291 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set); 291 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
292 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions); 292 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions);
293 configureRequest(request, bypassBehavior, *m_element, document.clientHin tsPreferences()); 293 configureRequest(request, bypassBehavior, *m_element, document.clientHin tsPreferences());
294 294
295 newImage = ImageResource::fetch(request, document.fetcher()); 295 ImageResource::PlaceholderRequestType placeholderRequestType = document. settings() && document.settings()->fetchImagePlaceholders() && updateBehavior != UpdateForcedReload
296 ? ImageResource::PlaceholderRequestType::AllowPlaceholder
297 : ImageResource::PlaceholderRequestType::DisallowPlaceholder;
298 newImage = ImageResource::fetch(request, document.fetcher(), placeholder RequestType);
296 299
297 if (!newImage && !pageIsBeingDismissed(&document)) { 300 if (!newImage && !pageIsBeingDismissed(&document)) {
298 crossSiteOrCSPViolationOccurred(imageSourceURL); 301 crossSiteOrCSPViolationOccurred(imageSourceURL);
299 dispatchErrorEvent(); 302 dispatchErrorEvent();
300 } else { 303 } else {
301 clearFailedLoadURL(); 304 clearFailedLoadURL();
302 } 305 }
303 } else { 306 } else {
304 if (!imageSourceURL.isNull()) { 307 if (!imageSourceURL.isNull()) {
305 // Fire an error event if the url string is not empty, but the KURL is. 308 // Fire an error event if the url string is not empty, but the KURL is.
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 608
606 void ImageLoader::elementDidMoveToNewDocument() 609 void ImageLoader::elementDidMoveToNewDocument()
607 { 610 {
608 if (m_loadDelayCounter) 611 if (m_loadDelayCounter)
609 m_loadDelayCounter->documentChanged(m_element->document()); 612 m_loadDelayCounter->documentChanged(m_element->document());
610 clearFailedLoadURL(); 613 clearFailedLoadURL();
611 setImage(0); 614 setImage(0);
612 } 615 }
613 616
614 } // namespace blink 617 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698