Index: third_party/WebKit/Source/wtf/text/StringView.cpp |
diff --git a/third_party/WebKit/Source/wtf/text/StringView.cpp b/third_party/WebKit/Source/wtf/text/StringView.cpp |
deleted file mode 100644 |
index 126272933a3b934b1baa4841b2dff01e73bcdddd..0000000000000000000000000000000000000000 |
--- a/third_party/WebKit/Source/wtf/text/StringView.cpp |
+++ /dev/null |
@@ -1,55 +0,0 @@ |
-// Copyright 2016 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. |
- |
-#include "wtf/text/StringView.h" |
- |
-namespace WTF { |
- |
-StringView::StringView(const UChar* chars, unsigned length) |
- : m_length(length) |
- , m_is8Bit(false) |
-{ |
- SECURITY_DCHECK(!chars || length <= lengthOfNullTerminatedString(chars)); |
- m_data.characters16 = chars; |
-} |
- |
-StringView::StringView(const UChar* chars) |
- : StringView(chars, chars ? lengthOfNullTerminatedString(chars) : 0) {} |
- |
-#if DCHECK_IS_ON() |
-StringView::~StringView() |
-{ |
- // StringView does not own the StringImpl, we must not be the last ref. |
- DCHECK(!m_impl || !m_impl->hasOneRef()); |
-} |
-#endif |
- |
-String StringView::toString() const |
-{ |
- if (isNull()) |
- return String(); |
- if (isEmpty()) |
- return emptyString(); |
- if (is8Bit()) |
- return String(m_data.characters8, m_length); |
- return String(m_data.characters16, m_length); |
-} |
- |
-bool equalStringView(const StringView& a, const StringView& b) |
-{ |
- if (a.length() != b.length()) |
- return false; |
- if (a.isEmpty() || b.isEmpty()) |
- return a.isEmpty() == b.isEmpty(); |
- if (a.is8Bit()) { |
- if (b.is8Bit()) |
- return equal(a.characters8(), b.characters8(), a.length()); |
- return equal(a.characters8(), b.characters16(), a.length()); |
- } |
- if (b.is8Bit()) |
- return equal(a.characters16(), b.characters8(), a.length()); |
- return equal(a.characters16(), b.characters16(), a.length()); |
-} |
- |
-} // namespace WTF |