[webkit-changes] cvs commit: WebKit/WebView.subproj WebHTMLView.m
John
sullivan at opensource.apple.com
Tue Jun 14 10:36:33 PDT 2005
sullivan 05/06/14 10:36:33
Modified: . ChangeLog
WebView.subproj WebHTMLView.m
Log:
Reviewed by Dave Harrison.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView _delayedEndPrintMode:]):
After discussing this with Dave, I made this method both more debugger-friendly with asserts for
the cases we don't think could ever happen, and more paranoid by handling these cases in deployment
builds.
Revision Changes Path
1.3194 +10 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3193
retrieving revision 1.3194
diff -u -r1.3193 -r1.3194
--- ChangeLog 14 Jun 2005 16:19:10 -0000 1.3193
+++ ChangeLog 14 Jun 2005 17:36:30 -0000 1.3194
@@ -1,3 +1,13 @@
+2005-06-14 John Sullivan <sullivan at apple.com>
+
+ Reviewed by Dave Harrison.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView _delayedEndPrintMode:]):
+ After discussing this with Dave, I made this method both more debugger-friendly with asserts for
+ the cases we don't think could ever happen, and more paranoid by handling these cases in deployment
+ builds.
+
2005-06-14 Darin Adler <darin at apple.com>
- fixed build for Xcode 2.1
1.451 +19 -3 WebKit/WebView.subproj/WebHTMLView.m
Index: WebHTMLView.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLView.m,v
retrieving revision 1.450
retrieving revision 1.451
diff -u -r1.450 -r1.451
--- WebHTMLView.m 14 Jun 2005 02:12:41 -0000 1.450
+++ WebHTMLView.m 14 Jun 2005 17:36:32 -0000 1.451
@@ -3157,10 +3157,26 @@
- (void)_delayedEndPrintMode:(NSPrintOperation *)initiatingOperation
{
ASSERT_ARG(initiatingOperation, initiatingOperation != nil);
- // If the operation that initiated this is still underway, delay further
- if (initiatingOperation == [NSPrintOperation currentOperation]) {
- [self performSelector:@selector(_delayedEndPrintMode:) withObject:nil afterDelay:0];
+ NSPrintOperation *currentOperation = [NSPrintOperation currentOperation];
+
+ if (initiatingOperation == currentOperation) {
+ // The print operation is still underway. We don't expect this to ever happen, hence the assert, but we're
+ // being extra paranoid here since the printing code is so fragile. Delay the cleanup
+ // further.
+ ASSERT_NOT_REACHED();
+ [self performSelector:@selector(_delayedEndPrintMode:) withObject:initiatingOperation afterDelay:0];
+ } else if ([currentOperation view] == self) {
+ // A new print job has started, but it is printing the same WebHTMLView again. We don't expect
+ // this to ever happen, hence the assert, but we're being extra paranoid here since the printing code is so
+ // fragile. Do nothing, because we don't want to break the print job currently in progress, and
+ // the print job currently in progress is responsible for its own cleanup.
+ ASSERT_NOT_REACHED();
} else {
+ // The print job that kicked off this delayed call has finished, and this view is not being
+ // printed again. We expect that no other print job has started. Since this delayed call wasn't
+ // cancelled, beginDocument and endDocument must not have been called, and we need to clean up
+ // the print mode here.
+ ASSERT(currentOperation == nil);
[self _endPrintMode];
}
}
More information about the webkit-changes
mailing list