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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp

Issue 2521823003: [ImageResource 1c] Change StyleFetchedImageSet from ResourceClient to ImageResourceObserver (Closed)
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleFetchedImageSet.h ('k') | no next file » | 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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 34
35 StyleFetchedImageSet::StyleFetchedImageSet(ImageResource* image, 35 StyleFetchedImageSet::StyleFetchedImageSet(ImageResource* image,
36 float imageScaleFactor, 36 float imageScaleFactor,
37 CSSImageSetValue* value, 37 CSSImageSetValue* value,
38 const KURL& url) 38 const KURL& url)
39 : m_bestFitImage(image), 39 : m_bestFitImage(image),
40 m_imageScaleFactor(imageScaleFactor), 40 m_imageScaleFactor(imageScaleFactor),
41 m_imageSetValue(value), 41 m_imageSetValue(value),
42 m_url(url) { 42 m_url(url) {
43 m_isImageResourceSet = true; 43 m_isImageResourceSet = true;
44 m_bestFitImage->addClient(this); 44 m_bestFitImage->addObserver(this);
45 ThreadState::current()->registerPreFinalizer(this); 45 ThreadState::current()->registerPreFinalizer(this);
46 } 46 }
47 47
48 StyleFetchedImageSet::~StyleFetchedImageSet() {} 48 StyleFetchedImageSet::~StyleFetchedImageSet() {}
49 49
50 void StyleFetchedImageSet::dispose() { 50 void StyleFetchedImageSet::dispose() {
51 m_bestFitImage->removeClient(this); 51 m_bestFitImage->removeObserver(this);
52 m_bestFitImage = nullptr; 52 m_bestFitImage = nullptr;
53 } 53 }
54 54
55 WrappedImagePtr StyleFetchedImageSet::data() const { 55 WrappedImagePtr StyleFetchedImageSet::data() const {
56 return m_bestFitImage.get(); 56 return m_bestFitImage.get();
57 } 57 }
58 58
59 ImageResource* StyleFetchedImageSet::cachedImage() const { 59 ImageResource* StyleFetchedImageSet::cachedImage() const {
60 return m_bestFitImage.get(); 60 return m_bestFitImage.get();
61 } 61 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "data", 132 TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "data",
133 InspectorPaintImageEvent::data(&layoutObject, *m_bestFitImage.get())); 133 InspectorPaintImageEvent::data(&layoutObject, *m_bestFitImage.get()));
134 return m_bestFitImage->getImage()->currentFrameKnownToBeOpaque( 134 return m_bestFitImage->getImage()->currentFrameKnownToBeOpaque(
135 Image::PreCacheMetadata); 135 Image::PreCacheMetadata);
136 } 136 }
137 137
138 DEFINE_TRACE(StyleFetchedImageSet) { 138 DEFINE_TRACE(StyleFetchedImageSet) {
139 visitor->trace(m_bestFitImage); 139 visitor->trace(m_bestFitImage);
140 visitor->trace(m_imageSetValue); 140 visitor->trace(m_imageSetValue);
141 StyleImage::trace(visitor); 141 StyleImage::trace(visitor);
142 ResourceClient::trace(visitor);
143 } 142 }
144 143
145 } // namespace blink 144 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleFetchedImageSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698