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

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

Issue 1472253003: Avoid RefPtr churn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void StyleFetchedImage::notifyFinished(Resource* resource) 119 void StyleFetchedImage::notifyFinished(Resource* resource)
120 { 120 {
121 if (m_document && m_image && m_image->image() && m_image->image()->isSVGImag e()) 121 if (m_document && m_image && m_image->image() && m_image->image()->isSVGImag e())
122 toSVGImage(m_image->image())->updateUseCounters(*m_document); 122 toSVGImage(m_image->image())->updateUseCounters(*m_document);
123 // Oilpan: do not prolong the Document's lifetime. 123 // Oilpan: do not prolong the Document's lifetime.
124 m_document.clear(); 124 m_document.clear();
125 } 125 }
126 126
127 PassRefPtr<Image> StyleFetchedImage::image(const LayoutObject*, const IntSize& c ontainerSize, float zoom) const 127 PassRefPtr<Image> StyleFetchedImage::image(const LayoutObject*, const IntSize& c ontainerSize, float zoom) const
128 { 128 {
129 RefPtr<Image> image = m_image->image(); 129 if (!m_image->image()->isSVGImage())
130 if (image->isSVGImage()) 130 return m_image->image();
131 return SVGImageForContainer::create(toSVGImage(image.get()), containerSi ze, zoom, m_url); 131
132 return image; 132 return SVGImageForContainer::create(toSVGImage(m_image->image()), containerS ize, zoom, m_url);
133 } 133 }
134 134
135 bool StyleFetchedImage::knownToBeOpaque(const LayoutObject* layoutObject) const 135 bool StyleFetchedImage::knownToBeOpaque(const LayoutObject* layoutObject) const
136 { 136 {
137 return m_image->currentFrameKnownToBeOpaque(layoutObject); 137 return m_image->currentFrameKnownToBeOpaque(layoutObject);
138 } 138 }
139 139
140 DEFINE_TRACE(StyleFetchedImage) 140 DEFINE_TRACE(StyleFetchedImage)
141 { 141 {
142 visitor->trace(m_document); 142 visitor->trace(m_document);
143 StyleImage::trace(visitor); 143 StyleImage::trace(visitor);
144 } 144 }
145 145
146 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698