diff options
Diffstat (limited to 'WebKit/mac/Misc/WebCoreStatistics.mm')
-rw-r--r-- | WebKit/mac/Misc/WebCoreStatistics.mm | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm index 9e8ae05..a5d5ae1 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.mm +++ b/WebKit/mac/Misc/WebCoreStatistics.mm @@ -37,6 +37,7 @@ #import <WebCore/Frame.h> #import <WebCore/GCController.h> #import <WebCore/GlyphPageTreeNode.h> +#import <WebCore/GraphicsContext.h> #import <WebCore/IconDatabase.h> #import <WebCore/JSDOMWindow.h> #import <WebCore/PageCache.h> @@ -196,10 +197,9 @@ using namespace WebCore; JSLock lock(SilenceAssertionsOnly); Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics(); return [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:fastMallocStatistics.heapSize], @"FastMallocHeapSize", - [NSNumber numberWithInt:fastMallocStatistics.freeSizeInHeap], @"FastMallocFreeSizeInHeap", - [NSNumber numberWithInt:fastMallocStatistics.freeSizeInCaches], @"FastMallocFreeSizeInCaches", - [NSNumber numberWithInt:fastMallocStatistics.returnedSize], @"FastMallocReturnedSize", + [NSNumber numberWithInt:fastMallocStatistics.reservedVMBytes], @"FastMallocReservedVMBytes", + [NSNumber numberWithInt:fastMallocStatistics.committedVMBytes], @"FastMallocCommittedVMBytes", + [NSNumber numberWithInt:fastMallocStatistics.freeListBytes], @"FastMallocFreeListBytes", [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize", [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize", nil]; @@ -256,9 +256,9 @@ using namespace WebCore; @implementation WebFrame (WebKitDebug) -- (NSString *)renderTreeAsExternalRepresentation +- (NSString *)renderTreeAsExternalRepresentationForPrinting:(BOOL)forPrinting { - return externalRepresentation(_private->coreFrame); + return externalRepresentation(_private->coreFrame, forPrinting ? RenderAsTextPrintingMode : RenderAsTextBehaviorNormal); } - (NSString *)counterValueForElement:(DOMElement*)element @@ -276,4 +276,29 @@ using namespace WebCore; return PrintContext::numberOfPages(_private->coreFrame, FloatSize(pageWidthInPixels, pageHeightInPixels)); } +- (NSString *)pageProperty:(const char *)propertyName:(int)pageNumber +{ + return PrintContext::pageProperty(_private->coreFrame, propertyName, pageNumber); +} + +- (bool)isPageBoxVisible:(int)pageNumber +{ + return PrintContext::isPageBoxVisible(_private->coreFrame, pageNumber); +} + +- (NSString *)pageSizeAndMarginsInPixels:(int)pageNumber:(int)width:(int)height:(int)marginTop:(int)marginRight:(int)marginBottom:(int)marginLeft +{ + return PrintContext::pageSizeAndMarginsInPixels(_private->coreFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); +} + +- (void)printToCGContext:(CGContextRef)cgContext:(float)pageWidthInPixels:(float)pageHeightInPixels +{ + Frame* coreFrame = _private->coreFrame; + if (!coreFrame) + return; + + GraphicsContext graphicsContext(cgContext); + PrintContext::spoolAllPagesWithBoundaries(coreFrame, graphicsContext, FloatSize(pageWidthInPixels, pageHeightInPixels)); +} + @end |