Bug 38030 - Add WebCore::dumpTextEncodingNameMap() to dump text encoding map on debug builds
Summary: Add WebCore::dumpTextEncodingNameMap() to dump text encoding map on debug builds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 21:32 PDT by David Kilzer (:ddkilzer)
Modified: 2010-04-23 10:19 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.02 KB, patch)
2010-04-22 21:32 PDT, David Kilzer (:ddkilzer)
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>