+2015-07-21 Simon Fraser <simon.fraser@apple.com>
+
+ Rename the 'View' log channel to 'Printing'
+ https://bugs.webkit.org/show_bug.cgi?id=147172
+
+ Reviewed by Zalan Bujtas.
+
+ "View" was a terrible name for a log channel that was all about printing.
+ Sort the log channels.
+
+ * Platform/Logging.h:
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView drawRect:]):
+ (-[WKView printOperationWithPrintInfo:forFrame:]):
+ * UIProcess/mac/WKPrintingView.mm:
+ (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
+ (pageDidComputePageRects):
+ (-[WKPrintingView knowsPageRange:]):
+ (-[WKPrintingView drawRect:]):
+ (-[WKPrintingView rectForPage:]):
+ (-[WKPrintingView beginDocument]):
+ (-[WKPrintingView endDocument]):
+
2015-07-21 Zalan Bujtas <zalan@apple.com>
[iOS] Menu drop down such as on nike.com does not stay
- (void)drawRect:(NSRect)rect
{
- LOG(View, "drawRect: x:%g, y:%g, width:%g, height:%g", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+ LOG(Printing, "drawRect: x:%g, y:%g, width:%g, height:%g", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
_data->_page->endPrinting();
}
- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef
{
- LOG(View, "Creating an NSPrintOperation for frame '%s'", toImpl(frameRef)->url().utf8().data());
+ LOG(Printing, "Creating an NSPrintOperation for frame '%s'", toImpl(frameRef)->url().utf8().data());
// FIXME: If the frame cannot be printed (e.g. if it contains an encrypted PDF that disallows
// printing), this function should return nil.
ASSERT(firstPage > 0);
ASSERT(firstPage <= lastPage);
- LOG(View, "WKPrintingView requesting PDF data for pages %u...%u", firstPage, lastPage);
+ LOG(Printing, "WKPrintingView requesting PDF data for pages %u...%u", firstPage, lastPage);
PrintInfo printInfo([_printOperation printInfo]);
// Return to printing mode if we're already back to screen (e.g. due to window resizing).
NSRect newFrameSize = NSMakeRect(0, 0,
ceil(lastPrintingPageRect.maxX() * view->_totalScaleFactorForPrinting),
ceil(lastPrintingPageRect.maxY() * view->_totalScaleFactorForPrinting));
- LOG(View, "WKPrintingView setting frame size to x:%g y:%g width:%g height:%g", newFrameSize.origin.x, newFrameSize.origin.y, newFrameSize.size.width, newFrameSize.size.height);
+ LOG(Printing, "WKPrintingView setting frame size to x:%g y:%g width:%g height:%g", newFrameSize.origin.x, newFrameSize.origin.y, newFrameSize.size.width, newFrameSize.size.height);
[view setFrame:newFrameSize];
if ([view _isPrintingPreview]) {
- (BOOL)knowsPageRange:(NSRangePointer)range
{
- LOG(View, "-[WKPrintingView %p knowsPageRange:], %s, %s", self, [self _hasPageRects] ? "print data is available" : "print data is not available yet", RunLoop::isMain() ? "on main thread" : "on secondary thread");
+ LOG(Printing, "-[WKPrintingView %p knowsPageRange:], %s, %s", self, [self _hasPageRects] ? "print data is available" : "print data is not available yet", RunLoop::isMain() ? "on main thread" : "on secondary thread");
ASSERT(_printOperation == [NSPrintOperation currentOperation]);
// Assuming that once we switch to printing from a secondary thread, we don't go back.
- (void)drawRect:(NSRect)nsRect
{
- LOG(View, "WKPrintingView %p printing rect x:%g, y:%g, width:%g, height:%g%s", self, nsRect.origin.x, nsRect.origin.y, nsRect.size.width, nsRect.size.height, [self _isPrintingPreview] ? " for preview" : "");
+ LOG(Printing, "WKPrintingView %p printing rect x:%g, y:%g, width:%g, height:%g%s", self, nsRect.origin.x, nsRect.origin.y, nsRect.size.width, nsRect.size.height, [self _isPrintingPreview] ? " for preview" : "");
ASSERT(_printOperation == [NSPrintOperation currentOperation]);
{
ASSERT(_printOperation == [NSPrintOperation currentOperation]);
if (![self _hasPageRects]) {
- LOG(View, "-[WKPrintingView %p rectForPage:%d] - data is not yet available", self, (int)page);
+ LOG(Printing, "-[WKPrintingView %p rectForPage:%d] - data is not yet available", self, (int)page);
if (!_webFrame->page()) {
// We may have not told AppKit how many pages there are, so it will try to print until a null rect is returned.
return NSMakeRect(0, 0, 0, 0);
IntRect rect = _printingPageRects[page - 1];
rect.scale(_totalScaleFactorForPrinting);
- LOG(View, "-[WKPrintingView %p rectForPage:%d] -> x %d, y %d, width %d, height %d", self, (int)page, rect.x(), rect.y(), rect.width(), rect.height());
+ LOG(Printing, "-[WKPrintingView %p rectForPage:%d] -> x %d, y %d, width %d, height %d", self, (int)page, rect.x(), rect.y(), rect.width(), rect.height());
return rect;
}
if (isForcingPreviewUpdate)
return;
- LOG(View, "-[WKPrintingView %p beginDocument]", self);
+ LOG(Printing, "-[WKPrintingView %p beginDocument]", self);
[super beginDocument];
if (isForcingPreviewUpdate)
return;
- LOG(View, "-[WKPrintingView %p endDocument] - clearing cached data", self);
+ LOG(Printing, "-[WKPrintingView %p endDocument] - clearing cached data", self);
// Both existing data and pending responses are now obsolete.
_printingPageRects.clear();