| Index: third_party/WebKit/Source/wtf/text/StringView.h
|
| diff --git a/third_party/WebKit/Source/wtf/text/StringView.h b/third_party/WebKit/Source/wtf/text/StringView.h
|
| index 6433c383e0bd17dd2a0022de3abf7697735fb371..a4ea6692240fd2a68a4f1b9e1034bff9ec30844a 100644
|
| --- a/third_party/WebKit/Source/wtf/text/StringView.h
|
| +++ b/third_party/WebKit/Source/wtf/text/StringView.h
|
| @@ -43,6 +43,14 @@ public:
|
| StringView(StringImpl*, unsigned offset);
|
| StringView(StringImpl*, unsigned offset, unsigned length);
|
|
|
| + // From a non-null StringImpl, avoids the null check.
|
| + StringView(StringImpl& impl)
|
| + : m_impl(&impl)
|
| + , m_bytes(impl.bytes())
|
| + , m_length(impl.length()) {}
|
| + StringView(StringImpl&, unsigned offset);
|
| + StringView(StringImpl&, unsigned offset, unsigned length);
|
| +
|
| // From an String, implemented in String.h
|
| inline StringView(const String&, unsigned offset, unsigned length);
|
| inline StringView(const String&, unsigned offset);
|
| @@ -175,6 +183,16 @@ inline StringView::StringView(StringImpl* impl, unsigned offset, unsigned length
|
| impl ? set(*impl, offset, length) : clear();
|
| }
|
|
|
| +inline StringView::StringView(StringImpl& impl, unsigned offset)
|
| +{
|
| + set(impl, offset, impl.length() - offset);
|
| +}
|
| +
|
| +inline StringView::StringView(StringImpl& impl, unsigned offset, unsigned length)
|
| +{
|
| + set(impl, offset, length);
|
| +}
|
| +
|
| inline void StringView::clear()
|
| {
|
| m_length = 0;
|
|
|