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

Unified Diff: Source/core/rendering/svg/RenderSVGResourceContainer.cpp

Issue 181713003: Have Document::accessSVGExtensions() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.h ('k') | Source/core/rendering/svg/SVGResources.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceContainer.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceContainer.cpp b/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
index 0f7ac9be140b042d83b0efc913b87cfd40bffbef..71e0f2c8b89971a8e4012d10b4f924576208c448 100644
--- a/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
@@ -32,7 +32,7 @@
namespace WebCore {
-static inline SVGDocumentExtensions* svgExtensionsFromElement(SVGElement* element)
+static inline SVGDocumentExtensions& svgExtensionsFromElement(SVGElement* element)
{
ASSERT(element);
return element->document().accessSVGExtensions();
@@ -51,7 +51,7 @@ RenderSVGResourceContainer::RenderSVGResourceContainer(SVGElement* node)
RenderSVGResourceContainer::~RenderSVGResourceContainer()
{
if (m_registered)
- svgExtensionsFromElement(element())->removeResource(m_id);
+ svgExtensionsFromElement(element()).removeResource(m_id);
}
void RenderSVGResourceContainer::layout()
@@ -92,8 +92,8 @@ void RenderSVGResourceContainer::idChanged()
removeAllClientsFromCache();
// Remove old id, that is guaranteed to be present in cache.
- SVGDocumentExtensions* extensions = svgExtensionsFromElement(element());
- extensions->removeResource(m_id);
+ SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
+ extensions.removeResource(m_id);
m_id = element()->getIdAttribute();
registerResource();
@@ -210,22 +210,22 @@ void RenderSVGResourceContainer::invalidateCacheAndMarkForLayout(SubtreeLayoutSc
void RenderSVGResourceContainer::registerResource()
{
- SVGDocumentExtensions* extensions = svgExtensionsFromElement(element());
- if (!extensions->hasPendingResource(m_id)) {
- extensions->addResource(m_id, this);
+ SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
+ if (!extensions.hasPendingResource(m_id)) {
+ extensions.addResource(m_id, this);
return;
}
- OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients(extensions->removePendingResource(m_id));
+ OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients(extensions.removePendingResource(m_id));
// Cache us with the new id.
- extensions->addResource(m_id, this);
+ extensions.addResource(m_id, this);
// Update cached resources of pending clients.
const SVGDocumentExtensions::SVGPendingElements::const_iterator end = clients->end();
for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) {
ASSERT((*it)->hasPendingResources());
- extensions->clearHasPendingResourcesIfPossible(*it);
+ extensions.clearHasPendingResourcesIfPossible(*it);
RenderObject* renderer = (*it)->renderer();
if (!renderer)
continue;
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.h ('k') | Source/core/rendering/svg/SVGResources.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698