Title: [288922] trunk/Source
Revision
288922
Author
[email protected]
Date
2022-02-01 16:08:19 -0800 (Tue, 01 Feb 2022)

Log Message

[WP] Remove PostScript conversion code
https://bugs.webkit.org/show_bug.cgi?id=235892
<rdar://88172449>

Reviewed by Tim Horton.

The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code.

Source/WebCore:

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::convertedDataIfNeeded const):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::convertPostScriptDataToPDF): Deleted.
* platform/graphics/cg/PDFDocumentImage.h:

Source/WebKit:

* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::pluginInfo):
(WebKit::PDFPlugin::streamDidReceiveResponse):
(WebKit::PDFPlugin::manualStreamDidReceiveResponse):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288921 => 288922)


--- trunk/Source/WebCore/ChangeLog	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebCore/ChangeLog	2022-02-02 00:08:19 UTC (rev 288922)
@@ -1,3 +1,19 @@
+2022-02-01  Per Arne Vollan  <[email protected]>
+
+        [WP] Remove PostScript conversion code
+        https://bugs.webkit.org/show_bug.cgi?id=235892
+        <rdar://88172449>
+
+        Reviewed by Tim Horton.
+
+        The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code.
+
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::convertedDataIfNeeded const):
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::convertPostScriptDataToPDF): Deleted.
+        * platform/graphics/cg/PDFDocumentImage.h:
+
 2022-02-01  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] Using Fontcascade::spaceWidth to subtract the trailing space width may result in incorrect layout

Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (288921 => 288922)


--- trunk/Source/WebCore/loader/cache/CachedImage.cpp	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp	2022-02-02 00:08:19 UTC (rev 288922)
@@ -527,15 +527,7 @@
 {
     if (!data)
         return nullptr;
-    if (!isPostScriptResource())
-        return data->makeContiguous();
-#if PLATFORM(MAC) && !USE(WEBKIT_IMAGE_DECODERS)
-    return SharedBuffer::create(PDFDocumentImage::convertPostScriptDataToPDF(data->makeContiguous()->createCFData()).get());
-#else
-    // Loading the image should have been canceled if the system does not support converting PostScript to PDF.
-    ASSERT_NOT_REACHED();
-    return nullptr;
-#endif
+    return data->makeContiguous();
 }
 
 void CachedImage::didUpdateImageData()

Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (288921 => 288922)


--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2022-02-02 00:08:19 UTC (rev 288922)
@@ -372,25 +372,6 @@
 
 #endif // !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
 
-#if PLATFORM(MAC)
-
-RetainPtr<CFMutableDataRef> PDFDocumentImage::convertPostScriptDataToPDF(RetainPtr<CFDataRef>&& postScriptData)
-{
-    // Convert PostScript to PDF using the Quartz 2D API.
-    // http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/chapter_16_section_1.html
-
-    CGPSConverterCallbacks callbacks = { };
-    auto converter = adoptCF(CGPSConverterCreate(0, &callbacks, 0));
-    auto provider = adoptCF(CGDataProviderCreateWithCFData(postScriptData.get()));
-    auto pdfData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
-    auto consumer = adoptCF(CGDataConsumerCreateWithCFData(pdfData.get()));
-
-    CGPSConverterConvert(converter.get(), provider.get(), consumer.get(), 0);
-    return pdfData;
-}
-
-#endif
-
 void PDFDocumentImage::dump(TextStream& ts) const
 {
     Image::dump(ts);

Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h (288921 => 288922)


--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h	2022-02-02 00:08:19 UTC (rev 288922)
@@ -58,10 +58,6 @@
 
     void setPdfImageCachingPolicy(PDFImageCachingPolicy);
     
-#if PLATFORM(MAC)
-    WEBCORE_EXPORT static RetainPtr<CFMutableDataRef> convertPostScriptDataToPDF(RetainPtr<CFDataRef>&& postScriptData);
-#endif
-
     unsigned cachingCountForTesting() const { return m_cachingCountForTesting; }
 
 private:

Modified: trunk/Source/WebKit/ChangeLog (288921 => 288922)


--- trunk/Source/WebKit/ChangeLog	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebKit/ChangeLog	2022-02-02 00:08:19 UTC (rev 288922)
@@ -1,3 +1,19 @@
+2022-02-01  Per Arne Vollan  <[email protected]>
+
+        [WP] Remove PostScript conversion code
+        https://bugs.webkit.org/show_bug.cgi?id=235892
+        <rdar://88172449>
+
+        Reviewed by Tim Horton.
+
+        The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code.
+
+        * WebProcess/Plugins/PDF/PDFPlugin.h:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::pluginInfo):
+        (WebKit::PDFPlugin::streamDidReceiveResponse):
+        (WebKit::PDFPlugin::manualStreamDidReceiveResponse):
+
 2022-02-01  Michael Saboff  <[email protected]>
 
         Catalyst builds of WebKit with system content path put XPCServices and Daemons in the normal location

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h (288921 => 288922)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2022-02-02 00:08:19 UTC (rev 288922)
@@ -296,7 +296,6 @@
 
     WeakPtr<WebFrame> m_frame;
 
-    bool m_isPostScript { false };
     bool m_pdfDocumentWasMutated { false };
 
     WebCore::IntSize m_scrollOffset;

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (288921 => 288922)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2022-02-02 00:07:58 UTC (rev 288921)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2022-02-02 00:08:19 UTC (rev 288922)
@@ -532,7 +532,6 @@
 using namespace WebCore;
 using namespace HTMLNames;
 
-static const char* postScriptMIMEType = "application/postscript";
 const uint64_t pdfDocumentRequestID = 1; // PluginController supports loading multiple streams, but we only need one for PDF.
 
 static void appendValuesInPDFNameSubtreeToVector(CGPDFDictionaryRef subtree, Vector<CGPDFObjectRef>& values)
@@ -1294,12 +1293,6 @@
     textPDFMimeClassInfo.extensions.append("pdf");
     info.mimes.append(textPDFMimeClassInfo);
 
-    MimeClassInfo postScriptMimeClassInfo;
-    postScriptMimeClassInfo.type = postScriptMIMEType;
-    postScriptMimeClassInfo.desc = postScriptDocumentTypeDescription();
-    postScriptMimeClassInfo.extensions.append("ps");
-    info.mimes.append(postScriptMimeClassInfo);
-    
     return info;
 }
 
@@ -1706,9 +1699,6 @@
     ASSERT_UNUSED(streamID, streamID == pdfDocumentRequestID);
 
     setSuggestedFilename(suggestedFilename);
-
-    if (equalIgnoringASCIICase(mimeType, postScriptMIMEType))
-        m_isPostScript = true;
 }
 
 void PDFPlugin::streamDidReceiveData(uint64_t streamID, const SharedBuffer& buffer)
@@ -1739,9 +1729,6 @@
 void PDFPlugin::manualStreamDidReceiveResponse(const URL& responseURL, uint32_t streamLength,  uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFilename)
 {
     setSuggestedFilename(suggestedFilename);
-
-    if (equalIgnoringASCIICase(mimeType, postScriptMIMEType))
-        m_isPostScript = true;
 }
 
 void PDFPlugin::ensureDataBufferLength(uint64_t targetLength)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to