Title: [289335] branches/safari-613-branch/Source
Revision
289335
Author
[email protected]
Date
2022-02-07 18:57:13 -0800 (Mon, 07 Feb 2022)

Log Message

Cherry-pick r288922. rdar://problem/88172449

    [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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288922 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (289334 => 289335)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-02-08 02:57:13 UTC (rev 289335)
@@ -1,5 +1,52 @@
 2022-02-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r288922. rdar://problem/88172449
+
+    [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):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r288881. rdar://problem/80246192
 
     Animation from scale(0) has missing backing store

Modified: branches/safari-613-branch/Source/WebCore/loader/cache/CachedImage.cpp (289334 => 289335)


--- branches/safari-613-branch/Source/WebCore/loader/cache/CachedImage.cpp	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebCore/loader/cache/CachedImage.cpp	2022-02-08 02:57:13 UTC (rev 289335)
@@ -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: branches/safari-613-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (289334 => 289335)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2022-02-08 02:57:13 UTC (rev 289335)
@@ -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: branches/safari-613-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h (289334 => 289335)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h	2022-02-08 02:57:13 UTC (rev 289335)
@@ -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: branches/safari-613-branch/Source/WebKit/ChangeLog (289334 => 289335)


--- branches/safari-613-branch/Source/WebKit/ChangeLog	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog	2022-02-08 02:57:13 UTC (rev 289335)
@@ -1,5 +1,52 @@
 2022-02-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r288922. rdar://problem/88172449
+
+    [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):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r288898. rdar://problem/87785042
 
     Protect NetworkConnectionToWebProcess::createFetchTask from a null service worker connection

Modified: branches/safari-613-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h (289334 => 289335)


--- branches/safari-613-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2022-02-08 02:57:13 UTC (rev 289335)
@@ -296,7 +296,6 @@
 
     WeakPtr<WebFrame> m_frame;
 
-    bool m_isPostScript { false };
     bool m_pdfDocumentWasMutated { false };
 
     WebCore::IntSize m_scrollOffset;

Modified: branches/safari-613-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (289334 => 289335)


--- branches/safari-613-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2022-02-08 02:57:09 UTC (rev 289334)
+++ branches/safari-613-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2022-02-08 02:57:13 UTC (rev 289335)
@@ -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