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

Side by Side Diff: Source/core/css/CSSImageValue.cpp

Issue 313043002: Notify DevTools about cached resources when stylesheet is restored. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 * (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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (!m_accessedImage || !m_image->isImageResource() || !document.fetcher()) 78 if (!m_accessedImage || !m_image->isImageResource() || !document.fetcher())
79 return; 79 return;
80 if (document.fetcher()->cachedResource(KURL(ParsedURLString, m_absoluteURL)) ) 80 if (document.fetcher()->cachedResource(KURL(ParsedURLString, m_absoluteURL)) )
81 return; 81 return;
82 82
83 ImageResource* resource = m_image->cachedImage(); 83 ImageResource* resource = m_image->cachedImage();
84 if (!resource) 84 if (!resource)
85 return; 85 return;
86 86
87 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isEmpty () ? FetchInitiatorTypeNames::css : m_initiatorName, resource->options()); 87 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isEmpty () ? FetchInitiatorTypeNames::css : m_initiatorName, resource->options());
88 document.fetcher()->notifyLoadedFromMemoryCache(resource);
88 document.fetcher()->requestLoadStarted(resource, request, ResourceFetcher::R esourceLoadingFromCache); 89 document.fetcher()->requestLoadStarted(resource, request, ResourceFetcher::R esourceLoadingFromCache);
89 } 90 }
90 91
91 bool CSSImageValue::hasFailedOrCanceledSubresources() const 92 bool CSSImageValue::hasFailedOrCanceledSubresources() const
92 { 93 {
93 if (!m_image || !m_image->isImageResource()) 94 if (!m_image || !m_image->isImageResource())
94 return false; 95 return false;
95 if (Resource* cachedResource = toStyleFetchedImage(m_image)->cachedImage()) 96 if (Resource* cachedResource = toStyleFetchedImage(m_image)->cachedImage())
96 return cachedResource->loadFailedOrCanceled(); 97 return cachedResource->loadFailedOrCanceled();
97 return true; 98 return true;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 { 130 {
130 KURL url = document.completeURL(m_relativeURL); 131 KURL url = document.completeURL(m_relativeURL);
131 if (url == m_absoluteURL) 132 if (url == m_absoluteURL)
132 return; 133 return;
133 m_absoluteURL = url.string(); 134 m_absoluteURL = url.string();
134 m_accessedImage = false; 135 m_accessedImage = false;
135 m_image.clear(); 136 m_image.clear();
136 } 137 }
137 138
138 } // namespace WebCore 139 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698