Use SinkDocument instead of PDFDocument; get rid of PDFDocument
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Aug 2014 22:01:34 +0000 (22:01 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Aug 2014 22:01:34 +0000 (22:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136414

Reviewed by Alexey Proskuryakov.

* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument):
* pdf/ios/PDFDocument.cpp: Removed.
* pdf/ios/PDFDocument.h: Removed.
Use the generic SinkDocument, which ignores all incoming data just like PDFDocument.
Delete the unnecessary and iOS-specific PDFDocument.cpp/h

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/DocumentWriter.cpp
Source/WebCore/pdf/ios/PDFDocument.cpp [deleted file]
Source/WebCore/pdf/ios/PDFDocument.h [deleted file]

index be388613b5d2e1fe2c2032cb7c98973e16077769..6a104efb7420ef429107d8e88243e56907704edb 100644 (file)
@@ -1,3 +1,18 @@
+2014-08-31  Tim Horton  <timothy_horton@apple.com>
+
+        Use SinkDocument instead of PDFDocument; get rid of PDFDocument
+        https://bugs.webkit.org/show_bug.cgi?id=136414
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/DocumentWriter.cpp:
+        (WebCore::DocumentWriter::createDocument):
+        * pdf/ios/PDFDocument.cpp: Removed.
+        * pdf/ios/PDFDocument.h: Removed.
+        Use the generic SinkDocument, which ignores all incoming data just like PDFDocument.
+        Delete the unnecessary and iOS-specific PDFDocument.cpp/h
+
 2014-08-31  Tim Horton  <timothy_horton@apple.com>
 
         Adjust an antique comment in Image::drawPattern
index 8df4e2187debc1029e093187633075da9d27e04d..773f3f3300bdf3ff8d42307cd02685288bf53af5 100644 (file)
                5179CE36195CAC7E0019C198 /* HIDGamepadProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5179CE34195CAC7E0019C198 /* HIDGamepadProvider.cpp */; };
                5179CE37195CAC7E0019C198 /* HIDGamepadProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5179CE35195CAC7E0019C198 /* HIDGamepadProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
                517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */; };
-               51889F0B1554AF3D004427F7 /* PDFDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51889F091554AF3D004427F7 /* PDFDocument.cpp */; };
-               51889F0C1554AF3D004427F7 /* PDFDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 51889F0A1554AF3D004427F7 /* PDFDocument.h */; };
                5189F01D10B37BD900F3C739 /* JSPopStateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5189F01B10B37BD900F3C739 /* JSPopStateEvent.cpp */; };
                5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5189F01C10B37BD900F3C739 /* JSPopStateEvent.h */; };
                5189F0DE10B46B0E00F3C739 /* PopStateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */; };
                5179CE35195CAC7E0019C198 /* HIDGamepadProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIDGamepadProvider.h; sourceTree = "<group>"; };
                517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtension.cpp; sourceTree = "<group>"; };
                517FBA18151AA71B00B57959 /* DOMWindowExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowExtension.h; sourceTree = "<group>"; };
-               51889F091554AF3D004427F7 /* PDFDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PDFDocument.cpp; sourceTree = "<group>"; };
-               51889F0A1554AF3D004427F7 /* PDFDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFDocument.h; sourceTree = "<group>"; };
                5189F01B10B37BD900F3C739 /* JSPopStateEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPopStateEvent.cpp; sourceTree = "<group>"; };
                5189F01C10B37BD900F3C739 /* JSPopStateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPopStateEvent.h; sourceTree = "<group>"; };
                5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PopStateEvent.cpp; sourceTree = "<group>"; };
                                BCB16BFB0979C38700467741 /* loader */,
                                FABE72EC1059C1EB00D999DD /* mathml */,
                                65BF02180974806300C43196 /* page */,
-                               51889F071554AF3D004427F7 /* pdf */,
                                BCF1A5BA097832090061A123 /* platform */,
                                5DCF83690D59157800953BC6 /* plugins */,
                                F523D2F302DE443B018635CA /* rendering */,
                        tabWidth = 4;
                        usesTabs = 0;
                };
-               51889F071554AF3D004427F7 /* pdf */ = {
-                       isa = PBXGroup;
-                       children = (
-                               51889F081554AF3D004427F7 /* ios */,
-                       );
-                       path = pdf;
-                       sourceTree = "<group>";
-               };
-               51889F081554AF3D004427F7 /* ios */ = {
-                       isa = PBXGroup;
-                       children = (
-                               51889F091554AF3D004427F7 /* PDFDocument.cpp */,
-                               51889F0A1554AF3D004427F7 /* PDFDocument.h */,
-                       );
-                       path = ios;
-                       sourceTree = "<group>";
-               };
                518F4FE9194CA4B60081BAAE /* gamepad */ = {
                        isa = PBXGroup;
                        children = (
                                A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */,
                                A8FA6E5D0E4CFDED00D5CF49 /* Pattern.h in Headers */,
                                B22279710D00BF220071B782 /* PatternAttributes.h in Headers */,
-                               51889F0C1554AF3D004427F7 /* PDFDocument.h in Headers */,
                                B27535650B053814002CE64F /* PDFDocumentImage.h in Headers */,
                                8A7CC96B12076D73001D4588 /* PendingScript.h in Headers */,
                                8A844D0511D3C18E0014065C /* Performance.h in Headers */,
                                A88DD4890B4629B000C02990 /* PathTraversalState.cpp in Sources */,
                                A8FA6E5E0E4CFDED00D5CF49 /* Pattern.cpp in Sources */,
                                A80A38FE0E50CC8200A25EBC /* PatternCG.cpp in Sources */,
-                               51889F0B1554AF3D004427F7 /* PDFDocument.cpp in Sources */,
                                B27535640B053814002CE64F /* PDFDocumentImage.cpp in Sources */,
                                2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */,
                                8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */,
index fa6e44da5ea82949465acb3bec914848a97ab4cd..200c0e32668189a2f66942845649476932e2526c 100644 (file)
 #include "TextResourceDecoder.h"
 #include <wtf/Ref.h>
 
-#if PLATFORM(IOS)
-#include "PDFDocument.h"
-#endif
-
 namespace WebCore {
 
 static inline bool canReferToParentFrameEncoding(const Frame* frame, const Frame* parentFrame) 
@@ -110,7 +106,7 @@ PassRefPtr<Document> DocumentWriter::createDocument(const URL& url)
         return PluginDocument::create(m_frame, url);
 #if PLATFORM(IOS)
     if (MIMETypeRegistry::isPDFMIMEType(m_mimeType) && (m_frame->isMainFrame() || !m_frame->settings().useImageDocumentForSubframePDF()))
-        return PDFDocument::create(m_frame, url);
+        return SinkDocument::create(m_frame, url);
 #endif
     if (!m_frame->loader().client().hasHTMLView())
         return Document::createNonRenderedPlaceholder(m_frame, url);
diff --git a/Source/WebCore/pdf/ios/PDFDocument.cpp b/Source/WebCore/pdf/ios/PDFDocument.cpp
deleted file mode 100644 (file)
index 76d4df3..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "PDFDocument.h"
-
-#if PLATFORM(IOS)
-
-#include "RawDataDocumentParser.h"
-
-namespace WebCore {
-
-class PDFDocumentParser : public RawDataDocumentParser {
-public:
-    static PassRefPtr<PDFDocumentParser> create(PDFDocument& document)
-    {
-        return adoptRef(new PDFDocumentParser(document));
-    }
-
-    PDFDocument* document() const
-    {
-        return static_cast<PDFDocument*>(RawDataDocumentParser::document());
-    }
-
-private:
-    PDFDocumentParser(PDFDocument& document)
-        : RawDataDocumentParser(document)
-    {
-    }
-
-    virtual void appendBytes(DocumentWriter&, const char*, size_t) override
-    {
-        // Ignore all calls
-    }
-};
-
-
-//------------
-
-PassRefPtr<DocumentParser> PDFDocument::createParser()
-{
-    return PDFDocumentParser::create(*this);
-}
-
-} // namespace WebCore
-
-#endif // PLATFORM(IOS)
diff --git a/Source/WebCore/pdf/ios/PDFDocument.h b/Source/WebCore/pdf/ios/PDFDocument.h
deleted file mode 100644 (file)
index 7e7b614..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef PDFDocument_h
-#define PDFDocument_h
-
-#if PLATFORM(IOS)
-
-#include "Document.h"
-
-namespace WebCore {
-
-class PDFDocument : public Document {
-public:
-    static PassRefPtr<PDFDocument> create(Frame* frame, const URL& url)
-    {
-        return adoptRef(new PDFDocument(frame, url));
-    }
-private:
-    PDFDocument(Frame* frame, const URL& url)
-        : Document(frame, url, DefaultDocumentClass, NonRenderedPlaceholder)
-    {
-    }
-
-    virtual PassRefPtr<DocumentParser> createParser() override;
-};
-    
-}
-
-#endif // PLATFORM(IOS)
-
-#endif // PDFDocument_h