Title: [104334] trunk/Source/WebKit2
- Revision
- 104334
- Author
- [email protected]
- Date
- 2012-01-06 14:01:00 -0800 (Fri, 06 Jan 2012)
Log Message
[Mac] Thread verifier assertions when printing
https://bugs.webkit.org/show_bug.cgi?id=75738
Reviewed by Sam Weinig.
* UIProcess/API/mac/WKPrintingView.mm:
(-[WKPrintingView dealloc]): Dealloc in main thread, so that WebFrameProxy doesn't get
deref'ed from a secondary one.
(-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): This method calls out to client,
which only expects that on main thread.
(-[WKPrintingView knowsPageRange:]): Call _adjustPrintingMarginsForHeaderAndFooter on main
thread.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (104333 => 104334)
--- trunk/Source/WebKit2/ChangeLog 2012-01-06 21:57:22 UTC (rev 104333)
+++ trunk/Source/WebKit2/ChangeLog 2012-01-06 22:01:00 UTC (rev 104334)
@@ -1,5 +1,20 @@
2012-01-06 Alexey Proskuryakov <[email protected]>
+ [Mac] Thread verifier assertions when printing
+ https://bugs.webkit.org/show_bug.cgi?id=75738
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/API/mac/WKPrintingView.mm:
+ (-[WKPrintingView dealloc]): Dealloc in main thread, so that WebFrameProxy doesn't get
+ deref'ed from a secondary one.
+ (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): This method calls out to client,
+ which only expects that on main thread.
+ (-[WKPrintingView knowsPageRange:]): Call _adjustPrintingMarginsForHeaderAndFooter on main
+ thread.
+
+2012-01-06 Alexey Proskuryakov <[email protected]>
+
Need to allow SCNetworkReachability service in sandbox profile
https://bugs.webkit.org/show_bug.cgi?id=75724
<rdar://problem/10652415>
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm (104333 => 104334)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm 2012-01-06 21:57:22 UTC (rev 104333)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm 2012-01-06 22:01:00 UTC (rev 104334)
@@ -30,6 +30,7 @@
#import "PrintInfo.h"
#import "WebData.h"
#import "WebPageProxy.h"
+#import <WebCore/WebCoreObjCExtras.h>
#import <wtf/MainThread.h>
using namespace WebKit;
@@ -56,6 +57,14 @@
return self;
}
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WKPrintingView class], self))
+ return;
+
+ [super dealloc];
+}
+
- (BOOL)isFlipped
{
return YES;
@@ -110,6 +119,8 @@
- (void)_adjustPrintingMarginsForHeaderAndFooter
{
+ ASSERT(isMainThread()); // This funciton calls the client, which should only be done on main thread.
+
NSPrintInfo *info = [_printOperation printInfo];
NSMutableDictionary *infoDictionary = [info dictionary];
@@ -364,7 +375,7 @@
[self _suspendAutodisplay];
- [self _adjustPrintingMarginsForHeaderAndFooter];
+ [self performSelectorOnMainThread:@selector(_adjustPrintingMarginsForHeaderAndFooter) withObject:nil waitUntilDone:YES];
if ([self _hasPageRects])
*range = NSMakeRange(1, _printingPageRects.size());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes