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

Unified Diff: Source/core/dom/Document.cpp

Issue 33013004: Have Document::mediaQueryMatcher() / Document::selectorQueryCache() return references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 351aca1e2be56489022c03087edadba8c005805c..4c5e2a32036df9ad187bb7d8b0dffbedc9b399b0 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -625,18 +625,18 @@ void Document::dispose()
lifecycleNotifier()->notifyDocumentWasDisposed();
}
-SelectorQueryCache* Document::selectorQueryCache()
+SelectorQueryCache& Document::selectorQueryCache()
{
if (!m_selectorQueryCache)
m_selectorQueryCache = adoptPtr(new SelectorQueryCache());
- return m_selectorQueryCache.get();
+ return *m_selectorQueryCache;
}
-MediaQueryMatcher* Document::mediaQueryMatcher()
+MediaQueryMatcher& Document::mediaQueryMatcher()
{
if (!m_mediaQueryMatcher)
m_mediaQueryMatcher = MediaQueryMatcher::create(this);
- return m_mediaQueryMatcher.get();
+ return *m_mediaQueryMatcher;
}
void Document::setCompatibilityMode(CompatibilityMode mode)
@@ -645,7 +645,7 @@ void Document::setCompatibilityMode(CompatibilityMode mode)
return;
bool wasInQuirksMode = inQuirksMode();
m_compatibilityMode = mode;
- selectorQueryCache()->invalidate();
+ selectorQueryCache().invalidate();
if (inQuirksMode() != wasInQuirksMode) {
// All user stylesheets have to reparse using the different mode.
m_styleEngine->clearPageUserSheet();
@@ -2638,7 +2638,7 @@ void Document::updateBaseURL()
// FIXME: Now that we don't support Objective-C this can probably be removed.
m_baseURL = KURL(ParsedURLString, documentURI());
}
- selectorQueryCache()->invalidate();
+ selectorQueryCache().invalidate();
if (!m_baseURL.isValid())
m_baseURL = KURL();
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698