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

Unified Diff: Source/core/html/parser/HTMLResourcePreloader.cpp

Issue 18328028: Enable MQ evaluation off the main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@threaded_mqe_rebase
Patch Set: Created 7 years, 5 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
Index: Source/core/html/parser/HTMLResourcePreloader.cpp
diff --git a/Source/core/html/parser/HTMLResourcePreloader.cpp b/Source/core/html/parser/HTMLResourcePreloader.cpp
index 0c1a17a714b774cd81fb305678fd725c4e7905de..a3d5bd0546b9cc5edc78d75478b820bfce9f076b 100644
--- a/Source/core/html/parser/HTMLResourcePreloader.cpp
+++ b/Source/core/html/parser/HTMLResourcePreloader.cpp
@@ -30,10 +30,6 @@
#include "core/loader/cache/CachedResourceInitiatorInfo.h"
#include "core/loader/cache/CachedResourceLoader.h"
-#include "core/css/MediaList.h"
-#include "core/css/MediaQueryEvaluator.h"
-#include "core/rendering/RenderObject.h"
-
namespace WebCore {
bool PreloadRequest::isSafeToSendToAnotherThread() const
@@ -41,7 +37,6 @@ bool PreloadRequest::isSafeToSendToAnotherThread() const
return m_initiatorName.isSafeToSendToAnotherThread()
&& m_charset.isSafeToSendToAnotherThread()
&& m_resourceURL.isSafeToSendToAnotherThread()
- && m_mediaAttribute.isSafeToSendToAnotherThread()
&& m_baseURL.isSafeToSendToAnotherThread();
}
@@ -73,21 +68,8 @@ void HTMLResourcePreloader::takeAndPreload(PreloadRequestStream& r)
preload(it->release());
}
-static bool mediaAttributeMatches(Frame* frame, RenderStyle* renderStyle, const String& attributeValue)
-{
- RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(attributeValue);
- MediaQueryEvaluator mediaQueryEvaluator("screen", frame, renderStyle);
- return mediaQueryEvaluator.eval(mediaQueries.get());
-}
-
void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload)
{
- ASSERT(m_document->frame());
- ASSERT(m_document->renderer());
- ASSERT(m_document->renderer()->style());
- if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderer()->style(), preload->media()))
- return;
-
CachedResourceRequest request = preload->resourceRequest(m_document);
m_document->cachedResourceLoader()->preload(preload->resourceType(), request, preload->charset());
}
« Source/core/css/MediaQueryExp.cpp ('K') | « Source/core/html/parser/HTMLResourcePreloader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698