OLD | NEW |
(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_ |
OLD | NEW |