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

Unified Diff: Source/core/css/MediaQuery.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/MediaQuery.h ('k') | Source/core/css/MediaQueryEvaluator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQuery.cpp
diff --git a/Source/core/css/MediaQuery.cpp b/Source/core/css/MediaQuery.cpp
index fc1dc9e6735d7293360173b7a0d82a4072a440ae..54067aff931c1a0151fd78cb2516373a5d2e56b7 100644
--- a/Source/core/css/MediaQuery.cpp
+++ b/Source/core/css/MediaQuery.cpp
@@ -29,7 +29,9 @@
#include "config.h"
#include "core/css/MediaQuery.h"
+#include "MediaTypeNames.h"
#include "core/css/MediaQueryExp.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "wtf/NonCopyingSort.h"
#include "wtf/text/StringBuilder.h"
@@ -55,7 +57,7 @@ String MediaQuery::serialize() const
return result.toString();
}
- if (m_mediaType != "all" || m_restrictor != None) {
+ if (m_mediaType != MediaTypeNames::all || m_restrictor != None) {
result.append(m_mediaType);
result.append(" and ");
}
@@ -73,9 +75,9 @@ static bool expressionCompare(const OwnPtrWillBeMember<MediaQueryExp>& a, const
return codePointCompare(a->serialize(), b->serialize()) < 0;
}
-MediaQuery::MediaQuery(Restrictor r, const AtomicString& mediaType, PassOwnPtrWillBeRawPtr<ExpressionHeapVector> expressions)
+MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtrWillBeRawPtr<ExpressionHeapVector> expressions)
: m_restrictor(r)
- , m_mediaType(mediaType.lower())
+ , m_mediaType(attemptStaticStringCreation(mediaType.lower()))
, m_expressions(expressions)
{
if (!m_expressions) {
« no previous file with comments | « Source/core/css/MediaQuery.h ('k') | Source/core/css/MediaQueryEvaluator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698