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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/third_party/blink/src/html_tokenizer.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/third_party/blink/src/html_tokenizer_adapter.h
diff --git a/ios/third_party/blink/src/html_tokenizer_adapter.h b/ios/third_party/blink/src/html_tokenizer_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..a16c5c09f3415dbd12740fac659cd02248b10aa3
--- /dev/null
+++ b/ios/third_party/blink/src/html_tokenizer_adapter.h
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
+#define IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
+
+#include "base/basictypes.h"
+#include "base/logging.h"
+
+#define ALWAYS_INLINE inline __attribute__((always_inline))
+
+#define DEFINE_STATIC_LOCAL_STRING(name, arguments) \
+ static const WebCore::LChar* name = (const WebCore::LChar*)arguments; \
+ static const size_t name##Length = (arraysize(arguments) - 1); \
+ DCHECK(name##Length == strlen((const char*)name))
+
+#define WTF_MAKE_NONCOPYABLE(x) DISALLOW_COPY_AND_ASSIGN(x)
+
+#define ASSERT(x) DCHECK(x)
+#define ASSERT_NOT_REACHED NOTREACHED
+
+#define notImplemented()
+
+namespace WebCore {
+typedef uint16 UChar;
+typedef uint8 LChar;
+
+template <typename CharType>
+inline bool isASCIIUpper(CharType c) {
+ return c >= 'A' && c <= 'Z';
+}
+
+template <typename CharType>
+inline bool isASCIILower(CharType c) {
+ return c >= 'a' && c <= 'z';
+}
+
+template <typename CharType>
+inline CharType toLowerCase(CharType c) {
+ ASSERT(isASCIIUpper(c));
+ const int lowerCaseOffset = 0x20;
+ return c + lowerCaseOffset;
+}
+
+inline UChar ByteSwap(UChar c) {
+ return ((c & 0x00ff) << 8) | ((c & 0xff00) >> 8);
+}
+}
+
+#endif // IOS_THIRD_PARTY_BLINK_SRC_TOKENIZER_ADAPTER_H_
« 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