Remove unused USE(OPENTYPE_SANITIZER) code.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Jan 2014 23:29:07 +0000 (23:29 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Jan 2014 23:29:07 +0000 (23:29 +0000)
<https://webkit.org/b/127710>

This code was only used by the Chromium port.

Reviewed by Darin Adler.

* GNUmakefile.list.am:
* WebCore.xcodeproj/project.pbxproj:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::ensureCustomFontData):
* platform/graphics/WOFFFileFormat.cpp:
* platform/graphics/WOFFFileFormat.h:
* platform/graphics/opentype/OpenTypeSanitizer.cpp: Removed.
* platform/graphics/opentype/OpenTypeSanitizer.h: Removed.

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

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/cache/CachedFont.cpp
Source/WebCore/platform/graphics/WOFFFileFormat.cpp
Source/WebCore/platform/graphics/WOFFFileFormat.h
Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.cpp [deleted file]
Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.h [deleted file]

index 257e73ce8119343a42ea813a36a70114e4401adc..e81e67b0038e5b1ee0ad7f631cb2cb502032cef8 100644 (file)
@@ -1,3 +1,22 @@
+2014-01-27  Andreas Kling  <akling@apple.com>
+
+        Remove unused USE(OPENTYPE_SANITIZER) code.
+        <https://webkit.org/b/127710>
+
+        This code was only used by the Chromium port.
+
+        Reviewed by Darin Adler.
+
+        * GNUmakefile.list.am:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/cache/CachedFont.cpp:
+        (WebCore::CachedFont::ensureCustomFontData):
+        * platform/graphics/WOFFFileFormat.cpp:
+        * platform/graphics/WOFFFileFormat.h:
+        * platform/graphics/opentype/OpenTypeSanitizer.cpp: Removed.
+        * platform/graphics/opentype/OpenTypeSanitizer.h: Removed.
+
+
 2014-01-27  Andy Estes  <aestes@apple.com>
 
         Stop the code generator from adding ENABLE() macros to Objective-C DOM headers
index 0d271c9a5a641200333b85e8baefe56199146a08..e91c65352ac5454e0f7c5b000669aa2903f0ea22 100644 (file)
@@ -6165,7 +6165,6 @@ platformgtk_sources += \
        Source/WebCore/platform/graphics/gtk/ImageGtk.cpp \
        Source/WebCore/platform/graphics/gtk/IntPointGtk.cpp \
        Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp \
-       Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.h \
        Source/WebCore/platform/graphics/opentype/OpenTypeTypes.h \
        Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp \
        Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.h \
index 1d500544b6e3017b74f3348af7fa225802cd1410..964ab776979f7467242c767416568163d0ba492b 100644 (file)
                F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */; };
                F3F5CF1112ED81A80084C569 /* InspectorConsoleInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */; };
                F3F5CF1312ED81B30084C569 /* InspectorDatabaseInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */; };
-               F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */; };
                F50664F7157F52DC00AC226F /* FormController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F50664F5157F52DC00AC226F /* FormController.cpp */; };
                F50664F8157F52DC00AC226F /* FormController.h in Headers */ = {isa = PBXBuildFile; fileRef = F50664F6157F52DC00AC226F /* FormController.h */; };
                F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F513A3E915FF4841001526DB /* ValidationMessageClient.h */; };
                F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMDebuggerAgent.h; sourceTree = "<group>"; };
                F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleInstrumentation.h; sourceTree = "<group>"; };
                F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseInstrumentation.h; sourceTree = "<group>"; };
-               F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenTypeSanitizer.h; path = opentype/OpenTypeSanitizer.h; sourceTree = "<group>"; };
                F50664F5157F52DC00AC226F /* FormController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormController.cpp; sourceTree = "<group>"; };
                F50664F6157F52DC00AC226F /* FormController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormController.h; sourceTree = "<group>"; };
                F513A3E915FF4841001526DB /* ValidationMessageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValidationMessageClient.h; sourceTree = "<group>"; };
                        name = mac;
                        sourceTree = "<group>";
                };
-               F4EAF4AB10C74268009100D3 /* opentype */ = {
-                       isa = PBXGroup;
-                       children = (
-                               F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */,
-                       );
-                       name = opentype;
-                       sourceTree = "<group>";
-               };
                F523D18402DE42E8018635CA /* css */ = {
                        isa = PBXGroup;
                        children = (
                                FDA3E95A134A49EF008D4B5A /* OfflineAudioCompletionEvent.h in Headers */,
                                FDA9325E16703B2A008982DC /* OfflineAudioContext.h in Headers */,
                                FDA3E95C134A49EF008D4B5A /* OfflineAudioDestinationNode.h in Headers */,
-                               F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */,
                                0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */,
                                FE9E89FC16E2DC0500A908F8 /* OriginLock.h in Headers */,
                                CD9DE18617AB0CF300EA386D /* HTMLMediaSource.h in Headers */,
index 12054c8b2d116357c1ba1a84e46972a693508cc0..b89d16c863e95b2384e13e544a9516215e91b027 100644 (file)
@@ -33,7 +33,6 @@
 #include "FontCustomPlatformData.h"
 #include "FontPlatformData.h"
 #include "MemoryCache.h"
-#include "OpenTypeSanitizer.h"
 #include "ResourceBuffer.h"
 #include "SharedBuffer.h"
 #include "TextResourceDecoder.h"
@@ -98,11 +97,6 @@ bool CachedFont::ensureCustomFontData()
         SharedBuffer* buffer = m_data.get()->sharedBuffer();
         ASSERT(buffer);
 
-#if USE(OPENTYPE_SANITIZER)
-        OpenTypeSanitizer sanitizer(buffer);
-        RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
-        buffer = transcodeBuffer.get();
-#else
         RefPtr<SharedBuffer> sfntBuffer;
         if (isWOFF(buffer)) {
             Vector<char> sfnt;
@@ -112,7 +106,6 @@ bool CachedFont::ensureCustomFontData()
             } else
                 buffer = nullptr;
         }
-#endif
 
         m_fontData = buffer ? createFontCustomPlatformData(*buffer) : nullptr;
         if (m_fontData)
index b9a91730be20679be3904ca6e28049a0af9ace72..051871ac6c60fb64392830aac6ad3852a94d4476 100644 (file)
@@ -27,8 +27,6 @@
 #include "WOFFFileFormat.h"
 #include <zlib.h>
 
-#if !USE(OPENTYPE_SANITIZER)
-
 #include "SharedBuffer.h"
 #include <wtf/ByteOrder.h>
 
@@ -219,5 +217,3 @@ bool convertWOFFToSfnt(SharedBuffer* woff, Vector<char>& sfnt)
 }
     
 } // namespace WebCore
-
-#endif // !USE(OPENTYPE_SANITIZER)
index 4face9b286901626372a2e3f7fed412043c07bb5..c6892fde184e0e7d713ae79fe63497d80d585d65 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef WOFFFileFormat_h
 #define WOFFFileFormat_h
 
-#if !USE(OPENTYPE_SANITIZER)
-
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -43,6 +41,4 @@ bool convertWOFFToSfnt(SharedBuffer* woff, Vector<char>& sfnt);
 
 } // namespace WebCore
 
-#endif // !USE(OPENTYPE_SANITIZER)
-
 #endif // WOFFFileFormat_h
diff --git a/Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.cpp b/Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.cpp
deleted file mode 100644 (file)
index 5d975c6..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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"
-#if USE(OPENTYPE_SANITIZER)
-#include "OpenTypeSanitizer.h"
-
-#include "SharedBuffer.h"
-#include "opentype-sanitiser.h"
-#include "ots-memory-stream.h"
-
-namespace WebCore {
-
-PassRefPtr<SharedBuffer> OpenTypeSanitizer::sanitize()
-{
-    if (!m_buffer)
-        return 0;
-
-    // This is the largest web font size which we'll try to transcode.
-    static const size_t maxWebFontSize = 30 * 1024 * 1024; // 30 MB
-    if (m_buffer->size() > maxWebFontSize)
-        return 0;
-
-    // A transcoded font is usually smaller than an original font.
-    // However, it can be slightly bigger than the original one due to
-    // name table replacement and/or padding for glyf table.
-    //
-    // With WOFF fonts, however, we'll be decompressing, so the result can be
-    // much larger than the original.
-
-    ots::ExpandingMemoryStream output(m_buffer->size(), maxWebFontSize);
-    if (!ots::Process(&output, reinterpret_cast<const uint8_t*>(m_buffer->data()), m_buffer->size()))
-        return 0;
-
-    const size_t transcodeLen = output.Tell();
-    return SharedBuffer::create(static_cast<unsigned char*>(output.get()), transcodeLen);
-}
-
-} // namespace WebCore
-
-#endif // USE(OPENTYPE_SANITIZER)
diff --git a/Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.h b/Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.h
deleted file mode 100644 (file)
index 5dca0fc..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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.
- */
-
-#ifndef OpenTypeSanitizer_h
-#define OpenTypeSanitizer_h
-
-#if USE(OPENTYPE_SANITIZER)
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-class SharedBuffer;
-
-class OpenTypeSanitizer {
-public:
-    explicit OpenTypeSanitizer(SharedBuffer* buffer)
-        : m_buffer(buffer)
-    {
-    }
-
-    PassRefPtr<SharedBuffer> sanitize();
-
-private:
-    SharedBuffer* const m_buffer;
-};
-
-} // namespace WebCore
-
-#endif // USE(OPENTYPE_SANITIZER)
-#endif // OpenTypeSanitizer_h