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

Unified Diff: Source/core/css/MediaQueryEvaluator.cpp

Issue 178803006: Turn MQ classes into thread safe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed StringImpl comparison atomic check Created 6 years, 9 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/css/MediaQueryEvaluator.h ('k') | Source/core/css/MediaQueryExp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryEvaluator.cpp
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index 5517dca39b0eaaefb05df229c598570cadb36815..37847a78b3cdfcd29a298d2fdb9dacaa2acdc04f 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -33,6 +33,7 @@
#include "CSSValueKeywords.h"
#include "MediaFeatureNames.h"
#include "MediaFeatures.h"
+#include "MediaTypeNames.h"
#include "core/css/CSSAspectRatioValue.h"
#include "core/css/CSSHelper.h"
#include "core/css/CSSPrimitiveValue.h"
@@ -70,7 +71,7 @@ MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult)
{
}
-MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType, bool mediaFeatureResult)
+MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, bool mediaFeatureResult)
: m_mediaType(acceptedMediaType)
, m_frame(0)
, m_style(nullptr)
@@ -86,7 +87,7 @@ MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType, bool med
{
}
-MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType, LocalFrame* frame, RenderStyle* style)
+MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, LocalFrame* frame, RenderStyle* style)
: m_mediaType(acceptedMediaType)
, m_frame(frame)
, m_style(style)
@@ -98,10 +99,10 @@ MediaQueryEvaluator::~MediaQueryEvaluator()
{
}
-bool MediaQueryEvaluator::mediaTypeMatch(const AtomicString& mediaTypeToMatch) const
+bool MediaQueryEvaluator::mediaTypeMatch(const String& mediaTypeToMatch) const
{
return mediaTypeToMatch.isEmpty()
- || equalIgnoringCase(mediaTypeToMatch, "all")
+ || equalIgnoringCase(mediaTypeToMatch, MediaTypeNames::all)
|| equalIgnoringCase(mediaTypeToMatch, m_mediaType);
}
@@ -110,7 +111,7 @@ bool MediaQueryEvaluator::mediaTypeMatchSpecific(const char* mediaTypeToMatch) c
// Like mediaTypeMatch, but without the special cases for "" and "all".
ASSERT(mediaTypeToMatch);
ASSERT(mediaTypeToMatch[0] != '\0');
- ASSERT(!equalIgnoringCase(mediaTypeToMatch, AtomicString("all")));
+ ASSERT(!equalIgnoringCase(mediaTypeToMatch, MediaTypeNames::all));
return equalIgnoringCase(mediaTypeToMatch, m_mediaType);
}
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.h ('k') | Source/core/css/MediaQueryExp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698