Revert of Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320) (patchset...
[chromium-blink-merge.git] / ios / third_party / blink / src / html_tokenizer_adapter.h
bloba16c5c09f3415dbd12740fac659cd02248b10aa3
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.
5 #ifndef IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
6 #define IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
8 #include "base/basictypes.h"
9 #include "base/logging.h"
11 #define ALWAYS_INLINE inline __attribute__((always_inline))
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))
18 #define WTF_MAKE_NONCOPYABLE(x) DISALLOW_COPY_AND_ASSIGN(x)
20 #define ASSERT(x) DCHECK(x)
21 #define ASSERT_NOT_REACHED NOTREACHED
23 #define notImplemented()
25 namespace WebCore {
26 typedef uint16 UChar;
27 typedef uint8 LChar;
29 template <typename CharType>
30 inline bool isASCIIUpper(CharType c) {
31 return c >= 'A' && c <= 'Z';
34 template <typename CharType>
35 inline bool isASCIILower(CharType c) {
36 return c >= 'a' && c <= 'z';
39 template <typename CharType>
40 inline CharType toLowerCase(CharType c) {
41 ASSERT(isASCIIUpper(c));
42 const int lowerCaseOffset = 0x20;
43 return c + lowerCaseOffset;
46 inline UChar ByteSwap(UChar c) {
47 return ((c & 0x00ff) << 8) | ((c & 0xff00) >> 8);
51 #endif // IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_