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

Side by Side Diff: Source/core/css/parser/MediaQueryInputStream.h

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed comment 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MediaQueryInputStream_h
6 #define MediaQueryInputStream_h
7
8 #include "wtf/text/WTFString.h"
9
10 namespace WebCore {
11
12 class MediaQueryInputStream {
13 WTF_MAKE_NONCOPYABLE(MediaQueryInputStream);
14 WTF_MAKE_FAST_ALLOCATED;
15 public:
16 MediaQueryInputStream(String input);
17
18 UChar currentInputChar();
19 UChar peek(unsigned);
20
21 void advance(unsigned = 1);
22 void pushBack(UChar);
23
24 unsigned long long getUInt(unsigned, unsigned);
25 double getDouble(unsigned, unsigned);
26
27 template<bool characterPredicate(UChar)>
28 unsigned skipWhilePredicate(unsigned offset)
29 {
30 while ((m_offset + offset) < m_string.length() && characterPredicate(m_s tring[m_offset + offset]))
31 ++offset;
32 return offset;
33 }
34
35 private:
36 size_t m_offset;
37 String m_string;
38 };
39
40 } // namespace WebCore
41
42 #endif // MediaQueryInputStream_h
43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698