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

Side by Side Diff: ios/third_party/blink/src/html_tokenizer_adapter.h

Issue 1031023002: Upstream ios/web/ HTML tokenizer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ios/third_party/blink/src/html_tokenizer.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
6 #define IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
7
8 #include "base/basictypes.h"
9 #include "base/logging.h"
10
11 #define ALWAYS_INLINE inline __attribute__((always_inline))
12
13 #define DEFINE_STATIC_LOCAL_STRING(name, arguments) \
14 static const WebCore::LChar* name = (const WebCore::LChar*)arguments; \
15 static const size_t name##Length = (arraysize(arguments) - 1); \
16 DCHECK(name##Length == strlen((const char*)name))
17
18 #define WTF_MAKE_NONCOPYABLE(x) DISALLOW_COPY_AND_ASSIGN(x)
19
20 #define ASSERT(x) DCHECK(x)
21 #define ASSERT_NOT_REACHED NOTREACHED
22
23 #define notImplemented()
24
25 namespace WebCore {
26 typedef uint16 UChar;
27 typedef uint8 LChar;
28
29 template <typename CharType>
30 inline bool isASCIIUpper(CharType c) {
31 return c >= 'A' && c <= 'Z';
32 }
33
34 template <typename CharType>
35 inline bool isASCIILower(CharType c) {
36 return c >= 'a' && c <= 'z';
37 }
38
39 template <typename CharType>
40 inline CharType toLowerCase(CharType c) {
41 ASSERT(isASCIIUpper(c));
42 const int lowerCaseOffset = 0x20;
43 return c + lowerCaseOffset;
44 }
45
46 inline UChar ByteSwap(UChar c) {
47 return ((c & 0x00ff) << 8) | ((c & 0xff00) >> 8);
48 }
49 }
50
51 #endif // IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
OLDNEW
« no previous file with comments | « ios/third_party/blink/src/html_tokenizer.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698