Bug 126644

Summary: Add WTF::StringView and use it for grammar checking
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, cshu, darin, eflews.bot, gyuyoung.kim, kling, koivisto, sam, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 118570    
Attachments:
Description Flags
Patch
none
Patch
none
Patch koivisto: review+, eflews.bot: commit-queue-

Anders Carlsson
Reported 2014-01-08 09:10:21 PST
Add WTF::StringView and use it for grammar checking
Attachments
Patch (28.29 KB, patch)
2014-01-08 09:23 PST, Anders Carlsson
no flags
Patch (28.62 KB, patch)
2014-01-08 09:29 PST, Anders Carlsson
no flags
Patch (28.65 KB, patch)
2014-01-08 11:26 PST, Anders Carlsson
koivisto: review+
eflews.bot: commit-queue-
Anders Carlsson
Comment 1 2014-01-08 09:23:32 PST
WebKit Commit Bot
Comment 2 2014-01-08 09:24:24 PST
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.
EFL EWS Bot
Comment 3 2014-01-08 09:29:09 PST
Anders Carlsson
Comment 4 2014-01-08 09:29:22 PST
WebKit Commit Bot
Comment 5 2014-01-08 09:31:00 PST
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.
Anders Carlsson
Comment 6 2014-01-08 09:34:34 PST
Comment on attachment 220639 [details] Patch Oops, this obviously won't work for 8-bit strings that can be 1-byte aligned.
Anders Carlsson
Comment 7 2014-01-08 11:26:09 PST
Antti Koivisto
Comment 8 2014-01-08 12:33:03 PST
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.
EFL EWS Bot
Comment 9 2014-01-08 12:53:14 PST
Anders Carlsson
Comment 10 2014-01-08 13:15:27 PST
Note You need to log in before you can comment on or make changes to this bug.