Add WTF::StringView and use it for grammar checking
Created attachment 220638 [details] Patch
Attachment 220638 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/GNUmakefile.list.am', u'Source/WTF/WTF.vcxproj/WTF.vcxproj', u'Source/WTF/WTF.vcxproj/WTF.vcxproj.filters', u'Source/WTF/WTF.xcodeproj/project.pbxproj', u'Source/WTF/wtf/CMakeLists.txt', u'Source/WTF/wtf/Forward.h', u'Source/WTF/wtf/text/StringView.h', u'Source/WebCore/ChangeLog', u'Source/WebCore/editing/TextCheckingHelper.cpp', u'Source/WebCore/loader/EmptyClients.h', u'Source/WebCore/platform/text/TextCheckerClient.h', u'Source/WebKit/efl/ChangeLog', u'Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h', u'Source/WebKit/mac/ChangeLog', u'Source/WebKit/mac/WebCoreSupport/WebEditorClient.h', u'Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp', u'Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h', '--commit-queue']" exit_code: 1 ERROR: Source/WTF/wtf/text/StringView.h:27: StringView_h is incorrect. #defined constants should use all uppercase names with words separated by underscores. [readability/naming/define/constants] [4] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 220638 [details] Patch Attachment 220638 [details] did not pass efl-ews (efl): Output: http://webkit-queues.appspot.com/results/5268129038991360
Created attachment 220639 [details] Patch
Attachment 220639 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/GNUmakefile.list.am', u'Source/WTF/WTF.vcxproj/WTF.vcxproj', u'Source/WTF/WTF.vcxproj/WTF.vcxproj.filters', u'Source/WTF/WTF.xcodeproj/project.pbxproj', u'Source/WTF/wtf/CMakeLists.txt', u'Source/WTF/wtf/Forward.h', u'Source/WTF/wtf/text/StringView.h', u'Source/WebCore/ChangeLog', u'Source/WebCore/editing/TextCheckingHelper.cpp', u'Source/WebCore/loader/EmptyClients.h', u'Source/WebCore/platform/text/TextCheckerClient.h', u'Source/WebKit/efl/ChangeLog', u'Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h', u'Source/WebKit/mac/ChangeLog', u'Source/WebKit/mac/WebCoreSupport/WebEditorClient.h', u'Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp', u'Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h', '--commit-queue']" exit_code: 1 ERROR: Source/WTF/wtf/text/StringView.h:27: StringView_h is incorrect. #defined constants should use all uppercase names with words separated by underscores. [readability/naming/define/constants] [4] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 220639 [details] Patch Oops, this obviously won't work for 8-bit strings that can be 1-byte aligned.
Created attachment 220646 [details] Patch
Comment on attachment 220646 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=220646&action=review > Source/WTF/ChangeLog:11 > + Add a new StringView class which is an immutable reference to either an 8-bit or a 16-bit string. > + > + This makes it easier to pass substrings around without having to either copy string data > + or upconvert and use UChar pointers. Might be good to mention std::string_view proposal since the name may be surprising. > Source/WTF/wtf/text/StringView.h:36 > +// (This means that strings longer than 2 Gigabytes can not be represented. If that turns out to be > +// a problem we can investigate alternative solutions). Those parentheses seem unnecessary.
Comment on attachment 220646 [details] Patch Attachment 220646 [details] did not pass efl-wk2-ews (efl-wk2): Output: http://webkit-queues.appspot.com/results/5487205254430720
Committed r161518: <http://trac.webkit.org/changeset/161518>