| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "wtf/text/StringView.h" | 5 #include "platform/wtf/text/StringView.h" |
| 6 | 6 |
| 7 #include "wtf/text/AtomicString.h" | 7 #include "platform/wtf/text/AtomicString.h" |
| 8 #include "wtf/text/StringImpl.h" | 8 #include "platform/wtf/text/StringImpl.h" |
| 9 #include "wtf/text/WTFString.h" | 9 #include "platform/wtf/text/WTFString.h" |
| 10 | 10 |
| 11 namespace WTF { | 11 namespace WTF { |
| 12 | 12 |
| 13 StringView::StringView(const UChar* chars) | 13 StringView::StringView(const UChar* chars) |
| 14 : StringView(chars, chars ? lengthOfNullTerminatedString(chars) : 0) {} | 14 : StringView(chars, chars ? lengthOfNullTerminatedString(chars) : 0) {} |
| 15 | 15 |
| 16 #if DCHECK_IS_ON() | 16 #if DCHECK_IS_ON() |
| 17 StringView::~StringView() { | 17 StringView::~StringView() { |
| 18 DCHECK(m_impl); | 18 DCHECK(m_impl); |
| 19 DCHECK(!m_impl->hasOneRef() || m_impl->isStatic()) | 19 DCHECK(!m_impl->hasOneRef() || m_impl->isStatic()) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return equalIgnoringASCIICase(a.characters8(), b.characters16(), | 92 return equalIgnoringASCIICase(a.characters8(), b.characters16(), |
| 93 a.length()); | 93 a.length()); |
| 94 } | 94 } |
| 95 if (b.is8Bit()) | 95 if (b.is8Bit()) |
| 96 return equalIgnoringASCIICase(a.characters16(), b.characters8(), | 96 return equalIgnoringASCIICase(a.characters16(), b.characters8(), |
| 97 a.length()); | 97 a.length()); |
| 98 return equalIgnoringASCIICase(a.characters16(), b.characters16(), a.length()); | 98 return equalIgnoringASCIICase(a.characters16(), b.characters16(), a.length()); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace WTF | 101 } // namespace WTF |
| OLD | NEW |