Back TextRun with a StringView
Created attachment 239124 [details] Patch
Comment on attachment 239124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239124&action=review > Source/WebCore/platform/graphics/TextRun.h:219 > + StringView m_data; m_data is not very descriptive. Just m_string perhaps?
Comment on attachment 239124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239124&action=review >> Source/WebCore/platform/graphics/TextRun.h:219 >> + StringView m_data; > > m_data is not very descriptive. Just m_string perhaps? Or m_text.
Comment on attachment 239124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239124&action=review > Source/WebCore/platform/graphics/TextRun.h:160 > + String string() const { return m_data.toString(); } This should be called text() to match setText. > Source/WebCore/platform/graphics/TextRun.h:193 > + StringView stringView() const { return m_data; } I don't see any clients to this accessor. Is it needed? If not, please remove it. >>> Source/WebCore/platform/graphics/TextRun.h:219 >>> + StringView m_data; >> >> m_data is not very descriptive. Just m_string perhaps? > > Or m_text. Or m_text.
Comment on attachment 239124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239124&action=review >> Source/WebCore/platform/graphics/TextRun.h:160 >> + String string() const { return m_data.toString(); } > > This should be called text() to match setText. Hmm, I guess the name is ok for something that constructs a String. It would be better to have an accessor called text() that returns a StringView and leave it to the callers to construct a String if they really need it.
Comment on attachment 239124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239124&action=review >>> Source/WebCore/platform/graphics/TextRun.h:160 >>> + String string() const { return m_data.toString(); } >> >> This should be called text() to match setText. > > Hmm, I guess the name is ok for something that constructs a String. It would be better to have an accessor called text() that returns a StringView and leave it to the callers to construct a String if they really need it. I've kept this and renamed stringView() to text(). Done. >> Source/WebCore/platform/graphics/TextRun.h:193 >> + StringView stringView() const { return m_data; } > > I don't see any clients to this accessor. Is it needed? If not, please remove it. Done. >>>> Source/WebCore/platform/graphics/TextRun.h:219 >>>> + StringView m_data; >>> >>> m_data is not very descriptive. Just m_string perhaps? >> >> Or m_text. > > Or m_text. Done.
http://trac.webkit.org/changeset/174228