WebKit Bugzilla
Attachment 339110 Details for
Bug 185084
: [iOS] Try to unlock PDF documents before printing them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185084-20180430083824.patch (text/plain), 2.73 KB, created by
Andy Estes
on 2018-04-30 08:38:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-04-30 08:38:24 PDT
Size:
2.73 KB
patch
obsolete
>Subversion Revision: 231156 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2ca3cdf1450ec2dbed89c81da56218169d7e28c7..fc002cb3e3a93b996d9676fc28fe62d56da1f8ca 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-04-27 Andy Estes <aestes@apple.com> >+ >+ [iOS] Try to unlock PDF documents before printing them >+ https://bugs.webkit.org/show_bug.cgi?id=185084 >+ <rdar://problem/39356622> >+ >+ Reviewed by Dan Bernstein. >+ >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]): >+ >+ Stored the password that successfully unlocked the current PDF document. >+ >+ (-[WKPDFView _wk_printedDocument]): >+ >+ Used the stored password to unlock the CGPDFDocument we create for printing. >+ > 2018-04-28 Andy Estes <aestes@apple.com> > > [iOS] Present an action sheet when long-pressing on PDF links >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index 2a0c1006cc15efb7bd0ffb182757927b998da462..5cbe8ceaf664f287c636e9ecb14bd4b28653e27a 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -57,6 +57,7 @@ @implementation WKPDFView { > RetainPtr<PDFHostViewController> _hostViewController; > CGSize _overlaidAccessoryViewsInset; > RetainPtr<UIView> _pageNumberIndicator; >+ RetainPtr<NSString> _password; > WebKit::InteractionInformationAtPosition _positionInformation; > RetainPtr<NSString> _suggestedFilename; > WebKit::WeakObjCPtr<WKWebView> _webView; >@@ -359,6 +360,11 @@ - (void)pdfHostViewController:(PDFHostViewController *)controller updatePageCoun > [self _scrollToURLFragment:[_webView URL].fragment]; > } > >+- (void)pdfHostViewController:(PDFHostViewController *)controller documentDidUnlockWithPassword:(NSString *)password >+{ >+ _password = adoptNS([password copy]); >+} >+ > - (void)pdfHostViewController:(PDFHostViewController *)controller findStringUpdate:(NSUInteger)numFound done:(BOOL)done > { > // FIXME: We should stop searching once numFound exceeds _findStringMaxCount, but PDFKit doesn't >@@ -498,7 +504,10 @@ - (NSUInteger)_wk_pageCountForPrintFormatter:(_WKWebViewPrintFormatter *)printFo > - (CGPDFDocumentRef)_wk_printedDocument > { > auto dataProvider = adoptCF(CGDataProviderCreateWithCFData((CFDataRef)_data.get())); >- return adoptCF(CGPDFDocumentCreateWithProvider(dataProvider.get())).autorelease(); >+ auto pdfDocument = adoptCF(CGPDFDocumentCreateWithProvider(dataProvider.get())); >+ if (!CGPDFDocumentIsUnlocked(pdfDocument.get())) >+ CGPDFDocumentUnlockWithPassword(pdfDocument.get(), [_password UTF8String]); >+ return pdfDocument.autorelease(); > } > > @end
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185084
:
339009
| 339110