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

Side by Side Diff: Source/core/css/CSSImageValue.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/css/CSSImageSetValue.cpp ('k') | Source/core/css/StyleRuleImport.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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return m_image.get(); 64 return m_image.get();
65 } 65 }
66 66
67 StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader) 67 StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader)
68 { 68 {
69 ASSERT(loader); 69 ASSERT(loader);
70 70
71 if (!m_accessedImage) { 71 if (!m_accessedImage) {
72 m_accessedImage = true; 72 m_accessedImage = true;
73 73
74 CachedResourceRequest request(ResourceRequest(loader->document()->comple teURL(m_url))); 74 CachedResourceRequest request(ResourceRequest(loader->document()->comple teURL(m_url)), m_initiatorName.isEmpty() ? cachedResourceRequestInitiators().css : m_initiatorName);
75 if (m_initiatorName.isEmpty())
76 request.setInitiator(cachedResourceRequestInitiators().css);
77 else
78 request.setInitiator(m_initiatorName);
79 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage (request)) 75 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage (request))
80 m_image = StyleCachedImage::create(cachedImage.get()); 76 m_image = StyleCachedImage::create(cachedImage.get());
81 } 77 }
82 78
83 return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage* >(m_image.get()) : 0; 79 return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage* >(m_image.get()) : 0;
84 } 80 }
85 81
86 bool CSSImageValue::hasFailedOrCanceledSubresources() const 82 bool CSSImageValue::hasFailedOrCanceledSubresources() const
87 { 83 {
88 if (!m_image || !m_image->isCachedImage()) 84 if (!m_image || !m_image->isCachedImage())
(...skipping 28 matching lines...) Expand all
117 info.addMember(m_url, "url"); 113 info.addMember(m_url, "url");
118 // No need to report m_image as it is counted as part of RenderArena. 114 // No need to report m_image as it is counted as part of RenderArena.
119 } 115 }
120 116
121 bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const 117 bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const
122 { 118 {
123 return m_image ? m_image->knownToBeOpaque(renderer) : false; 119 return m_image ? m_image->knownToBeOpaque(renderer) : false;
124 } 120 }
125 121
126 } // namespace WebCore 122 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSImageSetValue.cpp ('k') | Source/core/css/StyleRuleImport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698