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

Unified Diff: Source/core/css/parser/NewCSSTokenizer.h

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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/css/parser/NewCSSTokenizer.h
diff --git a/Source/core/html/URLRegistry.h b/Source/core/css/parser/NewCSSTokenizer.h
similarity index 62%
copy from Source/core/html/URLRegistry.h
copy to Source/core/css/parser/NewCSSTokenizer.h
index f6f2c3bcbf0020d347b1606f141bc379075ae41f..522da08ccde83f5577dfafcef948870c10543655 100644
--- a/Source/core/html/URLRegistry.h
+++ b/Source/core/css/parser/NewCSSTokenizer.h
@@ -28,35 +28,54 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef URLRegistry_h
-#define URLRegistry_h
+#ifndef NewCSSTokenizer_h
+#define NewCSSTokenizer_h
+#include "core/css/parser/CSSToken.h"
+#include "core/html/parser/InputStreamPreprocessor.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
-class KURL;
-class SecurityOrigin;
-class URLRegistry;
+class CSSInputStream;
-class URLRegistrable {
-public:
- virtual ~URLRegistrable() { }
- virtual URLRegistry& registry() const = 0;
-};
-
-class URLRegistry {
+class NewCSSTokenizer {
+ WTF_MAKE_NONCOPYABLE(NewCSSTokenizer);
WTF_MAKE_FAST_ALLOCATED;
public:
- virtual ~URLRegistry() { }
- virtual void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*) = 0;
- virtual void unregisterURL(const KURL&) = 0;
+ NewCSSTokenizer();
+
+ CSSToken nextToken(CSSInputStream&);
+ static void tokenize(String, Vector<CSSToken>&);
+
+private:
+ UChar consume();
+ void reconsume(UChar);
- // These are optional APIs
- virtual URLRegistrable* lookup(const String&) { ASSERT_NOT_REACHED(); return 0; }
- virtual bool contains(const String&) { ASSERT_NOT_REACHED(); return false; }
+ CSSToken consumeStringTokenUntil(UChar);
+ CSSToken consumeNumericToken();
+ CSSToken consumeIdentLikeToken();
+ CSSToken consumeNumber();
+ CSSToken consumeURLToken();
+
+ void consumeUntilNotWhitespace();
+ void consumeThroughCommentEndOrUntilEOF();
+
+ bool consumeIfNext(UChar);
+ bool consumeIfNext(String);
+ String consumeName();
+ UChar consumeEscape();
+
+ bool nextCharIsNameChar();
+ bool nextTwoCharsAreValidEscape();
+ bool nextCharsAreNumber();
+ bool nextCharsAreIdentifier();
+ double convertToNumber(String);
+
+ CSSInputStream* m_input;
};
+
} // namespace WebCore
-#endif // URLRegistry_h
+#endif // NewCSSTokenizer_h

Powered by Google App Engine
This is Rietveld 408576698