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

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: 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
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 AtomicString attr = m_element->imageSourceURL(); 173 AtomicString attr = m_element->imageSourceURL();
174 174
175 if (attr == m_failedLoadURL) 175 if (attr == m_failedLoadURL)
176 return; 176 return;
177 177
178 // Do not load any image if the 'src' attribute is missing or if it is 178 // Do not load any image if the 'src' attribute is missing or if it is
179 // an empty string. 179 // an empty string.
180 CachedResourceHandle<CachedImage> newImage = 0; 180 CachedResourceHandle<CachedImage> newImage = 0;
181 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) { 181 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
182 CachedResourceRequest request(ResourceRequest(document->completeURL(sour ceURI(attr)))); 182 CachedResourceRequest request(ResourceRequest(document->completeURL(sour ceURI(attr))), element()->localName());
183 request.setInitiator(element());
184 183
185 String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossori ginAttr); 184 String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossori ginAttr);
186 if (!crossOriginMode.isNull()) { 185 if (!crossOriginMode.isNull()) {
187 StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMo de, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials; 186 StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMo de, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
188 updateRequestForAccessControl(request.mutableResourceRequest(), docu ment->securityOrigin(), allowCredentials); 187 updateRequestForAccessControl(request.mutableResourceRequest(), docu ment->securityOrigin(), allowCredentials);
189 } 188 }
190 189
191 if (m_loadManually) { 190 if (m_loadManually) {
192 bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoa dImages(); 191 bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoa dImages();
193 document->cachedResourceLoader()->setAutoLoadImages(false); 192 document->cachedResourceLoader()->setAutoLoadImages(false);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 477 void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
479 { 478 {
480 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image); 479 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image);
481 info.addMember(m_element, "element"); 480 info.addMember(m_element, "element");
482 info.addMember(m_image.get(), "image", WTF::RetainingPointer); 481 info.addMember(m_image.get(), "image", WTF::RetainingPointer);
483 info.addMember(m_derefElementTimer, "derefElementTimer"); 482 info.addMember(m_derefElementTimer, "derefElementTimer");
484 info.addMember(m_failedLoadURL, "failedLoadURL"); 483 info.addMember(m_failedLoadURL, "failedLoadURL");
485 } 484 }
486 485
487 } 486 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698