Bug 16087

Summary: Clean up more DRT code
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
[PATCH] More refactoring for greater code readability
aroben: review+
[PATCH] Break out more of DumpRenderTree.mm into individual files timothy: review+

Description Eric Seidel (no email) 2007-11-21 16:46:24 PST
Again, I started to work on bug 15565 and ended up cleaning up more DRT code.  This is sorta a continuation of bug 16080, but I've attached the patches separately here.  This change also includes the resultString/resultData change found originally in bug 15558 (since this undoubtably breaks the patch attached to bug 15558).
Comment 1 Eric Seidel (no email) 2007-11-21 16:47:36 PST
Created attachment 17437 [details]
[PATCH] More refactoring for greater code readability

 WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm   |  384 +++++++++++---------
 WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h |    2 +-
 WebKitTools/DumpRenderTree/mac/UIDelegate.mm       |    2 +-
 3 files changed, 220 insertions(+), 168 deletions(-)
Comment 2 Adam Roben (:aroben) 2007-11-21 17:45:30 PST
Comment on attachment 17437 [details]
[PATCH] More refactoring for greater code readability

Your setup* methods should really be setUp*, since you're using the verb "to set up", not the noun "setup".

r=me, assuming the tests still pass :-)
Comment 3 Eric Seidel (no email) 2007-11-21 19:48:44 PST
Created attachment 17439 [details]
[PATCH] Break out more of DumpRenderTree.mm into individual files

 .../DumpRenderTree.xcodeproj/project.pbxproj       |   24 ++
 WebKitTools/DumpRenderTree/mac/CheckedMalloc.cpp   |   59 ++++
 WebKitTools/DumpRenderTree/mac/CheckedMalloc.h     |   31 ++
 WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm   |  320 +-------------------
 WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h |    3 +
 .../DumpRenderTree/mac/DumpRenderTreePasteboard.h  |    1 +
 .../DumpRenderTree/mac/DumpRenderTreePasteboard.m  |    1 +
 .../DumpRenderTree/mac/DumpRenderTreeWindow.h      |    1 +
 .../DumpRenderTree/mac/DumpRenderTreeWindow.mm     |    1 +
 .../DumpRenderTree/mac/JavaScriptThreading.cpp     |  132 ++++++++
 .../DumpRenderTree/mac/JavaScriptThreading.h       |   35 +++
 WebKitTools/DumpRenderTree/mac/PixelDumpSupport.h  |   38 +++
 WebKitTools/DumpRenderTree/mac/PixelDumpSupport.mm |  221 ++++++++++++++
 13 files changed, 558 insertions(+), 309 deletions(-)
Comment 4 Eric Seidel (no email) 2007-11-21 19:50:24 PST
Comment on attachment 17439 [details]
[PATCH] Break out more of DumpRenderTree.mm into individual files

I'm re-using this bug because it was already here.  Another relatively simple patch, restructuring more of DRT into individual files.  At some level this is needless code-churn.  At another, this is useful not only to future DRT hackers (for better hackability) but also for possible future abstraction.  For example, CheckedMalloc could already be used by any other DRT implementation.  With a little tweaking (to remove CF dependencies) JavaScriptThreading.* could as well.