Bug 38030

Summary: Add WebCore::dumpTextEncodingNameMap() to dump text encoding map on debug builds
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, hamaji, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch ap: review+

Description David Kilzer (:ddkilzer) 2010-04-22 21:32:30 PDT
Created attachment 54127 [details]
Patch

Reviewed by NOBODY (OOPS!).

* platform/text/TextEncodingRegistry.cpp:
(WebCore::dumpTextEncodingNameMap): Added.
* platform/text/TextEncodingRegistry.h:
(WebCore::dumpTextEncodingNameMap): Added declaration.
---
 3 files changed, 32 insertions(+), 0 deletions(-)
Comment 1 WebKit Review Bot 2010-04-22 21:34:21 PDT
Attachment 54127 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/platform/text/TextEncodingRegistry.cpp:331:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 2 David Kilzer (:ddkilzer) 2010-04-22 21:37:35 PDT
(In reply to comment #1)
> Attachment 54127 [details] did not pass style-queue:
> 
> Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
> WebCore/platform/text/TextEncodingRegistry.cpp:331:  Tests for true/false,
> null/non-null, and zero/non-zero should all be done without equality
> comparisons.  [readability/comparison_to_zero] [5]
> Total errors found: 1 in 3 files

+        if (++i % 400 == 0)

Would this really read better as:

+        if (!(++i % 400))
Comment 3 Alexey Proskuryakov 2010-04-22 21:59:11 PDT
Comment on attachment 54127 [details]
Patch

WebCore/platform/text/TextEncodingRegistry.cpp:332
 +              sleep(1); // Avoid asl log throttling.
This will be unhelpful when dumping to terminal, as it happens with run-safari or when debugging in gdb.

WebCore/ChangeLog:3
 +          Add WebCore::dumpTextEncodingNameMap() to dump text encoding map on debug builds
Please add bug URL to ChangeLog.
Comment 4 David Kilzer (:ddkilzer) 2010-04-23 00:22:44 PDT
(In reply to comment #3)
> (From update of attachment 54127 [details])
> WebCore/platform/text/TextEncodingRegistry.cpp:332
>  +              sleep(1); // Avoid asl log throttling.
> This will be unhelpful when dumping to terminal, as it happens with run-safari
> or when debugging in gdb.

Okay, I was testing with the iPhone Simulator at the time.  I'll just remove the throttling code.

> WebCore/ChangeLog:3
>  +          Add WebCore::dumpTextEncodingNameMap() to dump text encoding map on
> debug builds
> Please add bug URL to ChangeLog.

Done.  The current workflow with webkit-patch that I use doesn't allow the bug number to be known before the bug is created.
Comment 5 David Kilzer (:ddkilzer) 2010-04-23 01:05:46 PDT
Committed r58157: <http://trac.webkit.org/changeset/58157>
Comment 6 David Kilzer (:ddkilzer) 2010-04-23 10:19:39 PDT
(In reply to comment #5)
> Committed r58157: <http://trac.webkit.org/changeset/58157>

Follow-up fix in r58176.  <http://trac.webkit.org/changeset/58176>