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

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

Issue 1060483003: Add ImageLoader support for sizes based Client-Hints RW values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test failures Created 5 years, 8 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 | « Source/core/html/HTMLImageElement.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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld Behavior bypassBehavior, Element& element) 199 static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld Behavior bypassBehavior, Element& element)
200 { 200 {
201 if (bypassBehavior == ImageLoader::BypassMainWorldCSP) 201 if (bypassBehavior == ImageLoader::BypassMainWorldCSP)
202 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); 202 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
203 203
204 AtomicString crossOriginMode = element.fastGetAttribute(HTMLNames::crossorig inAttr); 204 AtomicString crossOriginMode = element.fastGetAttribute(HTMLNames::crossorig inAttr);
205 if (!crossOriginMode.isNull()) 205 if (!crossOriginMode.isNull())
206 request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOriginMode); 206 request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOriginMode);
207
208 if (isHTMLImageElement(element)) {
209 FetchRequest::ResourceWidth resourceWidth;
210 resourceWidth.width = toHTMLImageElement(element).sourceSize(element);
211 resourceWidth.isSet = true;
212 request.setResourceWidth(resourceWidth);
213 }
207 } 214 }
208 215
209 inline void ImageLoader::dispatchErrorEvent() 216 inline void ImageLoader::dispatchErrorEvent()
210 { 217 {
211 m_hasPendingErrorEvent = true; 218 m_hasPendingErrorEvent = true;
212 errorEventSender().dispatchEventSoon(this); 219 errorEventSender().dispatchEventSoon(this);
213 } 220 }
214 221
215 inline void ImageLoader::crossSiteOrCSPViolationOccurred(AtomicString imageSourc eURL) 222 inline void ImageLoader::crossSiteOrCSPViolationOccurred(AtomicString imageSourc eURL)
216 { 223 {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 #endif 612 #endif
606 } 613 }
607 614
608 #if ENABLE(OILPAN) 615 #if ENABLE(OILPAN)
609 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 616 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
610 { 617 {
611 m_loader.willRemoveClient(m_client); 618 m_loader.willRemoveClient(m_client);
612 } 619 }
613 #endif 620 #endif
614 } 621 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698