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

Unified Diff: third_party/WebKit/Source/core/css/CSSImageValue.cpp

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: fix Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSImageValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
index a0dd40cc494d381fd9bcc1ec7cca007b6265d58e..1a964668907724e2bc12eca8e14972d9b0ff20d5 100644
--- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
@@ -24,7 +24,7 @@
#include "core/dom/Document.h"
#include "core/fetch/FetchInitiatorTypeNames.h"
#include "core/fetch/FetchRequest.h"
-#include "core/fetch/ImageResource.h"
+#include "core/fetch/ImageResourceContent.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/frame/Settings.h"
#include "core/style/StyleFetchedImage.h"
@@ -67,8 +67,8 @@ StyleImage* CSSImageValue::cacheImage(const Document& document,
if (document.settings() && document.settings()->fetchImagePlaceholders())
request.setAllowImagePlaceholder();
- if (ImageResource* cachedImage =
- ImageResource::fetch(request, document.fetcher()))
+ if (ImageResourceContent* cachedImage =
+ ImageResourceContent::fetch(request, document.fetcher()))
m_cachedImage =
StyleFetchedImage::create(cachedImage, document, request.url());
else
@@ -83,13 +83,12 @@ void CSSImageValue::restoreCachedResourceIfNeeded(
if (!m_cachedImage || !document.fetcher() || m_absoluteURL.isNull())
return;
- ImageResource* resource = m_cachedImage->cachedImage();
- if (!resource)
+ ImageResourceContent* content = m_cachedImage->cachedImage();
+ if (!content)
return;
- document.fetcher()->emulateLoadStartedForInspector(
- resource, KURL(ParsedURLString, m_absoluteURL),
- WebURLRequest::RequestContextImage,
+ content->emulateLoadStartedForInspector(
+ document.fetcher(), KURL(ParsedURLString, m_absoluteURL),
m_initiatorName.isEmpty() ? FetchInitiatorTypeNames::css
: m_initiatorName);
}
@@ -97,7 +96,7 @@ void CSSImageValue::restoreCachedResourceIfNeeded(
bool CSSImageValue::hasFailedOrCanceledSubresources() const {
if (!m_cachedImage)
return false;
- if (Resource* cachedResource = m_cachedImage->cachedImage())
+ if (ImageResourceContent* cachedResource = m_cachedImage->cachedImage())
yhirano 2016/12/05 09:02:03 cachedResourceContent? I'm not sure if you want to
kouhei (in TOK) 2016/12/05 09:22:04 FYI: cachedResource is an obsolete name from the a
hiroshige 2016/12/06 09:32:50 I agree the names should be fixed. I'll rename the
return cachedResource->loadFailedOrCanceled();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698