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

Unified Diff: Source/wtf/text/StringView.h

Issue 23861003: Enable srcset support in HTMLImageElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a flaky test Created 7 years, 3 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 | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringView.h
diff --git a/Source/wtf/text/StringView.h b/Source/wtf/text/StringView.h
index 40d1866cf1dc4c277cd3fe51ebafe7358251efae..dc92fa346564c06b3dc7901ad4ab7fa211222e83 100644
--- a/Source/wtf/text/StringView.h
+++ b/Source/wtf/text/StringView.h
@@ -86,6 +86,15 @@ public:
return m_impl->characters16() + m_offset;
}
+ PassRefPtr<StringImpl> toString() const
+ {
+ if (!m_impl)
+ return m_impl;
+ if (m_impl->is8Bit())
+ return StringImpl::create(characters8(), m_length);
+ return StringImpl::create(characters16(), m_length);
+ }
+
private:
RefPtr<StringImpl> m_impl;
unsigned m_offset;
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698