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

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

Issue 1858533002: Introduce WebCachePolicy to merge cache policy enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hiroshige review Created 4 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
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 30 matching lines...) Expand all
41 #include "core/html/HTMLImageElement.h" 41 #include "core/html/HTMLImageElement.h"
42 #include "core/html/parser/HTMLParserIdioms.h" 42 #include "core/html/parser/HTMLParserIdioms.h"
43 #include "core/inspector/InspectorInstrumentation.h" 43 #include "core/inspector/InspectorInstrumentation.h"
44 #include "core/layout/LayoutImage.h" 44 #include "core/layout/LayoutImage.h"
45 #include "core/layout/LayoutVideo.h" 45 #include "core/layout/LayoutVideo.h"
46 #include "core/layout/svg/LayoutSVGImage.h" 46 #include "core/layout/svg/LayoutSVGImage.h"
47 #include "core/svg/graphics/SVGImage.h" 47 #include "core/svg/graphics/SVGImage.h"
48 #include "platform/Logging.h" 48 #include "platform/Logging.h"
49 #include "platform/weborigin/SecurityOrigin.h" 49 #include "platform/weborigin/SecurityOrigin.h"
50 #include "platform/weborigin/SecurityPolicy.h" 50 #include "platform/weborigin/SecurityPolicy.h"
51 #include "public/platform/WebCachePolicy.h"
51 #include "public/platform/WebURLRequest.h" 52 #include "public/platform/WebURLRequest.h"
52 53
53 namespace blink { 54 namespace blink {
54 55
55 static ImageEventSender& loadEventSender() 56 static ImageEventSender& loadEventSender()
56 { 57 {
57 DEFINE_STATIC_LOCAL(ImageEventSender, sender, (ImageEventSender::create(Even tTypeNames::load))); 58 DEFINE_STATIC_LOCAL(ImageEventSender, sender, (ImageEventSender::create(Even tTypeNames::load)));
58 return sender; 59 return sender;
59 } 60 }
60 61
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return; 276 return;
276 277
277 AtomicString imageSourceURL = m_element->imageSourceURL(); 278 AtomicString imageSourceURL = m_element->imageSourceURL();
278 KURL url = imageSourceToKURL(imageSourceURL); 279 KURL url = imageSourceToKURL(imageSourceURL);
279 ImageResource* newImage = nullptr; 280 ImageResource* newImage = nullptr;
280 if (!url.isNull()) { 281 if (!url.isNull()) {
281 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 282 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
282 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 283 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
283 ResourceRequest resourceRequest(url); 284 ResourceRequest resourceRequest(url);
284 if (updateBehavior == UpdateForcedReload) { 285 if (updateBehavior == UpdateForcedReload) {
285 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::Bypassing Cache); 286 resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);
286 resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 287 resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
287 // ImageLoader defers the load of images when in an ImageDocument. 288 // ImageLoader defers the load of images when in an ImageDocument.
288 // Don't defer this load on a forced reload. 289 // Don't defer this load on a forced reload.
289 m_loadingImageDocument = false; 290 m_loadingImageDocument = false;
290 } 291 }
291 292
292 if (referrerPolicy != ReferrerPolicyDefault) 293 if (referrerPolicy != ReferrerPolicyDefault)
293 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref errerPolicy, url, document.outgoingReferrer())); 294 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref errerPolicy, url, document.outgoingReferrer()));
294 295
295 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) 296 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull())
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 614
614 void ImageLoader::elementDidMoveToNewDocument() 615 void ImageLoader::elementDidMoveToNewDocument()
615 { 616 {
616 if (m_loadDelayCounter) 617 if (m_loadDelayCounter)
617 m_loadDelayCounter->documentChanged(m_element->document()); 618 m_loadDelayCounter->documentChanged(m_element->document());
618 clearFailedLoadURL(); 619 clearFailedLoadURL();
619 setImage(0); 620 setImage(0);
620 } 621 }
621 622
622 } // namespace blink 623 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698