Bug 176035 - Logger should use makeString instead of String::format
Summary: Logger should use makeString instead of String::format
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks: 30342
  Show dependency treegraph
 
Reported: 2017-08-28 14:01 PDT by Eric Carlson
Modified: 2019-02-03 12:25 PST (History)
6 users (show)

See Also:


Attachments
Proposed patch. (10.22 KB, patch)
2017-08-28 14:27 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Proposed patch. (10.22 KB, patch)
2017-08-28 14:33 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Proposed patch. (10.27 KB, patch)
2017-08-28 14:54 PDT, Eric Carlson
jer.noble: review+
Details | Formatted Diff | Diff
Patch for landing. (10.26 KB, patch)
2017-08-28 19:04 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2017-08-28 14:01:14 PDT
As noted in bug 175988, String::format is not type safe so Logger should use makeString instead.
Comment 1 Eric Carlson 2017-08-28 14:27:04 PDT
Created attachment 319207 [details]
Proposed patch.
Comment 2 Build Bot 2017-08-28 14:29:07 PDT
Attachment 319207 [details] did not pass style-queue:


ERROR: Source/WebCore/PAL/pal/Logger.h:39:  This { should be at the end of the previous line  [whitespace/braces] [4]
ERROR: Source/WebCore/PAL/pal/Logger.h:137:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WebCore/PAL/pal/Logger.h:138:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 3 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Eric Carlson 2017-08-28 14:33:45 PDT
Created attachment 319208 [details]
Proposed patch.
Comment 4 Eric Carlson 2017-08-28 14:54:12 PDT
Created attachment 319212 [details]
Proposed patch.
Comment 5 Alex Christensen 2017-08-28 16:06:15 PDT
Comment on attachment 319212 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=319212&action=review

> Source/WebCore/PAL/pal/Logger.h:40
> +    template<typename U = T> static typename std::enable_if<std::is_same<U, int>::value, String>::type toString(int argument) { return String::number(argument); }

This could be slightly abbreviated if you used std::enable_if_t instead of std::enable_if<...>::type
Comment 6 Eric Carlson 2017-08-28 19:04:29 PDT
Created attachment 319227 [details]
Patch for landing.
Comment 7 WebKit Commit Bot 2017-08-28 19:58:52 PDT
The commit-queue encountered the following flaky tests while processing attachment 319227 [details]:

http/tests/security/cross-origin-xsl-BLOCKED.html bug 51054 (authors: abarth@webkit.org, jochen@chromium.org, and rniwa@webkit.org)
The commit-queue is continuing to process your patch.
Comment 8 WebKit Commit Bot 2017-08-28 19:59:22 PDT
Comment on attachment 319227 [details]
Patch for landing.

Clearing flags on attachment: 319227

Committed r221288: <http://trac.webkit.org/changeset/221288>
Comment 9 Darin Adler 2019-02-03 12:24:25 PST
Looks like this was resolved more than a year ago.
Comment 10 Radar WebKit Bug Importer 2019-02-03 12:25:27 PST
<rdar://problem/47773077>