Bug 33568

Summary: [BREWMP] Port vprintf_stderr_common
Product: WebKit Reporter: Kwang Yul Seo <skyul>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: beergun, commit-queue, eric, joybro201, tkent, webkit.review.bot, xhiloh
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Other   
Bug Depends on:    
Bug Blocks: 33564    
Attachments:
Description Flags
Port vprintf_stderr_common to BREW
none
Port vprintf_stderr_common
eric: review-
Port vprintf_stderr_common
none
Port vprintf_stderr_common
none
Port vprintf_stderr_common
eric: review-
Patch none

Description Kwang Yul Seo 2010-01-12 18:27:04 PST
Use BREW's DBGPRINTF to output debug messages.
Comment 1 Kwang Yul Seo 2010-01-12 18:34:24 PST
Created attachment 46419 [details]
Port vprintf_stderr_common to BREW
Comment 2 WebKit Review Bot 2010-01-12 18:38:03 PST
Attachment 46419 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
JavaScriptCore/wtf/Assertions.cpp:113:  Use 0 instead of NULL.  [readability/null] [4]
JavaScriptCore/wtf/Assertions.cpp:115:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 2
Comment 3 Kwang Yul Seo 2010-01-22 18:32:51 PST
Created attachment 47256 [details]
Port vprintf_stderr_common

Use PLATFORM(BREWMP).
Comment 4 Eric Seidel (no email) 2010-01-26 14:44:03 PST
Comment on attachment 47256 [details]
Port vprintf_stderr_common

OK, but lets fix Assertions.h for the COMPILE_ASSERT problem.

If you're mallocing locally, you should use an OwnPtr.  Or maybe a Vector<char> here.
Comment 5 Kwang Yul Seo 2010-01-26 18:05:33 PST
Created attachment 47479 [details]
Port vprintf_stderr_common

Remove #undef COMPILE_ASSERT and use Vector<char>.
Comment 6 WebKit Review Bot 2010-01-26 18:09:11 PST
Attachment 47479 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
JavaScriptCore/wtf/Assertions.cpp:112:  Use 0 instead of NULL.  [readability/null] [4]
JavaScriptCore/wtf/Assertions.cpp:114:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 2


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Kwang Yul Seo 2010-01-26 18:10:49 PST
Created attachment 47480 [details]
Port vprintf_stderr_common

Fix style errors.
Comment 8 WebKit Review Bot 2010-01-26 18:15:09 PST
Attachment 47480 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
JavaScriptCore/wtf/Assertions.cpp:112:  Use 0 instead of NULL.  [readability/null] [4]
Total errors found: 1


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Kwang Yul Seo 2010-01-26 18:18:03 PST
It seems that check-webkit-style complains about NULL in the comment.
Comment 10 Kwang Yul Seo 2010-01-26 18:19:17 PST
Created attachment 47481 [details]
Port vprintf_stderr_common 

Replace NULL with 0 in the comment.
Comment 11 Eric Seidel (no email) 2010-02-04 16:54:04 PST
Comment on attachment 47481 [details]
Port vprintf_stderr_common 

I probably would have made the while loop its own function which took a Vector<char>& and knew how to walk the vector spitting out chunks to the debug stream.

This should probably just be "static":
 123     char printBuffer[printBufferSize + 1];

Can VSNPRINTF ever return < 0?  If so, then this code can deadlock.

I guess I would have used buffer.size() to bound my while loop instead of the return value from VSNPRINTF.  That way you know for sure that you never walk off the end of the Vector.
Comment 12 Kwang Yul Seo 2010-07-02 13:32:00 PDT
Created attachment 60397 [details]
Patch

Follow Eric's advice.
Comment 13 Kwang Yul Seo 2010-08-27 08:49:01 PDT
Ping.
Comment 14 Kent Tamura 2010-08-29 18:21:50 PDT
Comment on attachment 60397 [details]
Patch

Looks ok.
Comment 15 WebKit Commit Bot 2010-08-29 18:47:19 PDT
Comment on attachment 60397 [details]
Patch

Clearing flags on attachment: 60397

Committed r66345: <http://trac.webkit.org/changeset/66345>
Comment 16 WebKit Commit Bot 2010-08-29 18:47:25 PDT
All reviewed patches have been landed.  Closing bug.