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

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

Issue 1738753002: Revert of Set the request mode and the credentials mode of FetchEvent in the service worker correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 return; 318 return;
319 319
320 AtomicString imageSourceURL = m_element->imageSourceURL(); 320 AtomicString imageSourceURL = m_element->imageSourceURL();
321 KURL url = imageSourceToKURL(imageSourceURL); 321 KURL url = imageSourceToKURL(imageSourceURL);
322 RefPtrWillBeRawPtr<ImageResource> newImage = nullptr; 322 RefPtrWillBeRawPtr<ImageResource> newImage = nullptr;
323 RefPtrWillBeRawPtr<Element> protectElement(m_element.get()); 323 RefPtrWillBeRawPtr<Element> protectElement(m_element.get());
324 if (!url.isNull()) { 324 if (!url.isNull()) {
325 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 325 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
326 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 326 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
327 ResourceRequest resourceRequest(url); 327 ResourceRequest resourceRequest(url);
328 resourceRequest.setFetchCredentialsMode(WebURLRequest::FetchCredentialsM odeSameOrigin);
328 if (updateBehavior == UpdateForcedReload) { 329 if (updateBehavior == UpdateForcedReload) {
329 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadByp assingCache); 330 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadByp assingCache);
330 resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 331 resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
331 // ImageLoader defers the load of images when in an ImageDocument. 332 // ImageLoader defers the load of images when in an ImageDocument.
332 // Don't defer this load on a forced reload. 333 // Don't defer this load on a forced reload.
333 m_loadingImageDocument = false; 334 m_loadingImageDocument = false;
334 } 335 }
335 336
336 if (RuntimeEnabledFeatures::referrerPolicyAttributeEnabled() && referrer Policy != ReferrerPolicyDefault) 337 if (RuntimeEnabledFeatures::referrerPolicyAttributeEnabled() && referrer Policy != ReferrerPolicyDefault)
337 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref errerPolicy, url, document.outgoingReferrer())); 338 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref errerPolicy, url, document.outgoingReferrer()));
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 689
689 void ImageLoader::sourceImageChanged() 690 void ImageLoader::sourceImageChanged()
690 { 691 {
691 for (auto& client : m_clients) { 692 for (auto& client : m_clients) {
692 ImageLoaderClient* handle = client; 693 ImageLoaderClient* handle = client;
693 handle->notifyImageSourceChanged(); 694 handle->notifyImageSourceChanged();
694 } 695 }
695 } 696 }
696 697
697 } // namespace blink 698 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698