Bug 196471

Summary: Add SPI to give injected bundles access to displayed PDFDocuments
Product: WebKit Reporter: Remy Demarest <rdemarest>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, rdemarest, thorton
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac   
OS: macOS 10.14   
Attachments:
Description Flags
Patch
thorton: review+
Updated patch
thorton: review+, thorton: commit-queue-
Updated patch using autorelease() none

Description Remy Demarest 2019-04-01 17:03:51 PDT
Add SPI to give injected bundles access to displayed PDFDocuments
Comment 1 Remy Demarest 2019-04-01 17:04:13 PDT
<rdar://problem/49339242>
Comment 2 Remy Demarest 2019-04-01 17:10:38 PDT
Created attachment 366445 [details]
Patch
Comment 3 EWS Watchlist 2019-04-01 17:13:18 PDT
Attachment 366445 [details] did not pass style-queue:


ERROR: Source/WebKit/WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm:31:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKit/WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h:26:  Use #pragma once instead of #ifndef for header guard.  [build/header_guard] [5]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Tim Horton 2019-04-01 17:13:34 PDT
Comment on attachment 366445 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=366445&action=review

> Source/WebKit/WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h:40
> +#ifdef __OBJC__

I feel like at this point you can just toss the whole file in #ifdef __OBJC__, no need to open and close it a few times

> Source/WebKit/WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm:36
> +#include <WebCore/Frame.h>

#import!
Comment 5 Remy Demarest 2019-04-01 17:19:03 PDT
Created attachment 366448 [details]
Updated patch
Comment 6 Tim Horton 2019-04-01 18:13:56 PDT
Comment on attachment 366448 [details]
Updated patch

View in context: https://bugs.webkit.org/attachment.cgi?id=366448&action=review

> Source/WebKit/WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm:48
> +    return pluginView->pdfDocumentForPrinting().get();

Unlikely to come up, but shouldn't this be a .autorelease()?
Comment 7 Remy Demarest 2019-04-01 18:22:00 PDT
Created attachment 366451 [details]
Updated patch using autorelease()
Comment 8 WebKit Commit Bot 2019-04-01 19:04:36 PDT
Comment on attachment 366451 [details]
Updated patch using autorelease()

Clearing flags on attachment: 366451

Committed r243731: <https://trac.webkit.org/changeset/243731>
Comment 9 WebKit Commit Bot 2019-04-01 19:04:37 PDT
All reviewed patches have been landed.  Closing bug.