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

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

Issue 14672042: Prepare to add more initiator info to CachedResource(Request) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.cpp ('k') | Source/core/loader/LinkLoader.cpp » ('j') | 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 AtomicString attr = m_element->imageSourceURL(); 170 AtomicString attr = m_element->imageSourceURL();
171 171
172 if (attr == m_failedLoadURL) 172 if (attr == m_failedLoadURL)
173 return; 173 return;
174 174
175 // Do not load any image if the 'src' attribute is missing or if it is 175 // Do not load any image if the 'src' attribute is missing or if it is
176 // an empty string. 176 // an empty string.
177 CachedResourceHandle<CachedImage> newImage = 0; 177 CachedResourceHandle<CachedImage> newImage = 0;
178 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) { 178 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
179 CachedResourceRequest request(ResourceRequest(document->completeURL(sour ceURI(attr)))); 179 CachedResourceRequest request(ResourceRequest(document->completeURL(sour ceURI(attr))), element()->localName());
180 request.setInitiator(element());
181 180
182 String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossori ginAttr); 181 String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossori ginAttr);
183 if (!crossOriginMode.isNull()) { 182 if (!crossOriginMode.isNull()) {
184 StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMo de, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials; 183 StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMo de, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
185 updateRequestForAccessControl(request.mutableResourceRequest(), docu ment->securityOrigin(), allowCredentials); 184 updateRequestForAccessControl(request.mutableResourceRequest(), docu ment->securityOrigin(), allowCredentials);
186 } 185 }
187 186
188 if (m_loadManually) { 187 if (m_loadManually) {
189 bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoa dImages(); 188 bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoa dImages();
190 document->cachedResourceLoader()->setAutoLoadImages(false); 189 document->cachedResourceLoader()->setAutoLoadImages(false);
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 472 void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
474 { 473 {
475 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image); 474 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image);
476 info.addMember(m_element, "element"); 475 info.addMember(m_element, "element");
477 info.addMember(m_image.get(), "image", WTF::RetainingPointer); 476 info.addMember(m_image.get(), "image", WTF::RetainingPointer);
478 info.addMember(m_derefElementTimer, "derefElementTimer"); 477 info.addMember(m_derefElementTimer, "derefElementTimer");
479 info.addMember(m_failedLoadURL, "failedLoadURL"); 478 info.addMember(m_failedLoadURL, "failedLoadURL");
480 } 479 }
481 480
482 } 481 }
OLDNEW
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.cpp ('k') | Source/core/loader/LinkLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698