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

Side by Side Diff: trunk/Source/core/css/MediaQuery.cpp

Issue 196653020: Revert 169289 "A thread-safe Media Query Parser" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/Source/core/css/MediaQuery.h ('k') | trunk/Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * CSS Media Query 2 * CSS Media Query
3 * 3 *
4 * Copyright (C) 2005, 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2005, 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 result.append(m_expressions->at(i)->serialize()); 68 result.append(m_expressions->at(i)->serialize());
69 } 69 }
70 return result.toString(); 70 return result.toString();
71 } 71 }
72 72
73 static bool expressionCompare(const OwnPtrWillBeMember<MediaQueryExp>& a, const OwnPtrWillBeMember<MediaQueryExp>& b) 73 static bool expressionCompare(const OwnPtrWillBeMember<MediaQueryExp>& a, const OwnPtrWillBeMember<MediaQueryExp>& b)
74 { 74 {
75 return codePointCompare(a->serialize(), b->serialize()) < 0; 75 return codePointCompare(a->serialize(), b->serialize()) < 0;
76 } 76 }
77 77
78 PassOwnPtrWillBeRawPtr<MediaQuery> MediaQuery::createNotAll()
79 {
80 return adoptPtrWillBeNoop(new MediaQuery(MediaQuery::Not, "all", nullptr));
81 }
82
83 MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtrWillBeRa wPtr<ExpressionHeapVector> expressions) 78 MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtrWillBeRa wPtr<ExpressionHeapVector> expressions)
84 : m_restrictor(r) 79 : m_restrictor(r)
85 , m_mediaType(attemptStaticStringCreation(mediaType.lower())) 80 , m_mediaType(attemptStaticStringCreation(mediaType.lower()))
86 , m_expressions(expressions) 81 , m_expressions(expressions)
87 { 82 {
88 if (!m_expressions) { 83 if (!m_expressions) {
89 m_expressions = adoptPtrWillBeNoop(new ExpressionHeapVector); 84 m_expressions = adoptPtrWillBeNoop(new ExpressionHeapVector);
90 return; 85 return;
91 } 86 }
92 87
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 void MediaQuery::trace(Visitor* visitor) 131 void MediaQuery::trace(Visitor* visitor)
137 { 132 {
138 // We don't support tracing of vectors of OwnPtrs (ie. OwnPtr<Vector<OwnPtr< MediaQuery> > >). 133 // We don't support tracing of vectors of OwnPtrs (ie. OwnPtr<Vector<OwnPtr< MediaQuery> > >).
139 // Since this is a transitional object we are just ifdef'ing it out when oil pan is not enabled. 134 // Since this is a transitional object we are just ifdef'ing it out when oil pan is not enabled.
140 #if ENABLE(OILPAN) 135 #if ENABLE(OILPAN)
141 visitor->trace(m_expressions); 136 visitor->trace(m_expressions);
142 #endif 137 #endif
143 } 138 }
144 139
145 } 140 }
OLDNEW
« no previous file with comments | « trunk/Source/core/css/MediaQuery.h ('k') | trunk/Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698