Remove iOS specific disk image cache
authorpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Sep 2014 17:36:21 +0000 (17:36 +0000)
committerpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Sep 2014 17:36:21 +0000 (17:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136517

Reviewed by Antti Koivisto.

Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
this now since we don't enable it in WebKit2 on iOS.

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceBuffer.cpp:
(WebCore::ResourceBuffer::isUsingDiskImageCache): Deleted.
* loader/ResourceBuffer.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::canUseDiskImageCache): Deleted.
(WebCore::CachedImage::useDiskImageCache): Deleted.
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isUsingDiskImageCache): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::canUseDiskImageCache): Deleted.
(WebCore::CachedResource::useDiskImageCache): Deleted.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::TypeStatistic::addResource):
(WebCore::MemoryCache::dumpStats):
(WebCore::MemoryCache::dumpLRULists):
(WebCore::MemoryCache::flushCachedImagesToDisk): Deleted.
* loader/cache/MemoryCache.h:
(WebCore::MemoryCache::TypeStatistic::TypeStatistic):
* loader/ios/DiskImageCacheClientIOS.h: Removed.
* loader/ios/DiskImageCacheIOS.h: Removed.
* loader/ios/DiskImageCacheIOS.mm: Removed.
* platform/Logging.h:
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::~SharedBuffer):
(WebCore::SharedBuffer::data):
(WebCore::SharedBuffer::append):
(WebCore::SharedBuffer::buffer):
(WebCore::SharedBuffer::getSomeData):
(WebCore::SharedBuffer::isAllowedToBeMemoryMapped): Deleted.
(WebCore::SharedBuffer::allowToBeMemoryMapped): Deleted.
(WebCore::SharedBuffer::failedMemoryMap): Deleted.
(WebCore::SharedBuffer::markAsMemoryMapped): Deleted.
(WebCore::SharedBuffer::memoryMappedNotificationCallbackData): Deleted.
(WebCore::SharedBuffer::memoryMappedNotificationCallback): Deleted.
(WebCore::SharedBuffer::setMemoryMappedNotificationCallback): Deleted.
* platform/SharedBuffer.h:
(WebCore::SharedBuffer::isMemoryMapped): Deleted.
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::SharedBuffer):
* platform/mac/SharedBufferMac.mm:
(-[WebCoreSharedBufferData length]):
(-[WebCoreSharedBufferData bytes]):
(WebCore::SharedBuffer::createCFData):
(-[WebCoreSharedBufferData initWithMemoryMappedSharedBuffer:]): Deleted.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/ios:

* WebCoreSupport/WebDiskImageCacheClientIOS.h: Removed.
* WebCoreSupport/WebDiskImageCacheClientIOS.mm: Removed.
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder finishedLoadingWithDataSource:]):
(-[WebPDFViewPlaceholder dataSourceMemoryMapped]): Deleted.
(-[WebPDFViewPlaceholder dataSourceMemoryMapFailed]): Deleted.

Source/WebKit/mac:

* Misc/WebCache.mm:
(+[WebCache statistics]):
* WebView/WebDataSource.mm:
(-[WebDataSource _setAllowToBeMemoryMapped]):
(-[WebDataSource setDataSourceDelegate:]):
(-[WebDataSource dataSourceDelegate]):
(-[WebDataSource dealloc]):
(BufferMemoryMapped): Deleted.
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences diskImageCacheEnabled]): Deleted.
(-[WebPreferences setDiskImageCacheEnabled:]): Deleted.
(-[WebPreferences diskImageCacheMinimumImageSize]): Deleted.
(-[WebPreferences setDiskImageCacheMinimumImageSize:]): Deleted.
(-[WebPreferences diskImageCacheMaximumCacheSize]): Deleted.
(-[WebPreferences setDiskImageCacheMaximumCacheSize:]): Deleted.
(-[WebPreferences _diskImageCacheSavedCacheDirectory]): Deleted.
(-[WebPreferences _setDiskImageCacheSavedCacheDirectory:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(+[WebView _handleMemoryWarning]):
(-[WebView _preferencesChanged:]):

Source/WTF:

* wtf/FeatureDefines.h:

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

34 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/FeatureDefines.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/ResourceBuffer.cpp
Source/WebCore/loader/ResourceBuffer.h
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/loader/ios/DiskImageCacheClientIOS.h [deleted file]
Source/WebCore/loader/ios/DiskImageCacheIOS.h [deleted file]
Source/WebCore/loader/ios/DiskImageCacheIOS.mm [deleted file]
Source/WebCore/platform/Logging.h
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/cf/SharedBufferCF.cpp
Source/WebCore/platform/mac/SharedBufferMac.mm
Source/WebKit/ChangeLog
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h [deleted file]
Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm [deleted file]
Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebCache.mm
Source/WebKit/mac/WebView/WebDataSource.mm
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm

index 5c5dd10..ce771b4 100644 (file)
@@ -1,3 +1,15 @@
+2014-09-04  Pratik Solanki  <psolanki@apple.com>
+
+        Remove iOS specific disk image cache
+        https://bugs.webkit.org/show_bug.cgi?id=136517
+
+        Reviewed by Antti Koivisto.
+
+        Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
+        this now since we don't enable it in WebKit2 on iOS.
+
+        * wtf/FeatureDefines.h:
+
 2014-09-03  Dan Bernstein  <mitz@apple.com>
 
         Get rid of HIGH_DPI_CANVAS leftovers
index 2ce0942..18179f9 100644 (file)
 #define ENABLE_CURSOR_SUPPORT 0
 #endif
 
-#if !defined(ENABLE_DISK_IMAGE_CACHE)
-#define ENABLE_DISK_IMAGE_CACHE 1
-#endif
-
 #if !defined(ENABLE_DRAG_SUPPORT)
 #define ENABLE_DRAG_SUPPORT 0
 #endif
index 88b07e7..d749fb4 100644 (file)
@@ -1,3 +1,62 @@
+2014-09-04  Pratik Solanki  <psolanki@apple.com>
+
+        Remove iOS specific disk image cache
+        https://bugs.webkit.org/show_bug.cgi?id=136517
+
+        Reviewed by Antti Koivisto.
+
+        Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
+        this now since we don't enable it in WebKit2 on iOS.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/ResourceBuffer.cpp:
+        (WebCore::ResourceBuffer::isUsingDiskImageCache): Deleted.
+        * loader/ResourceBuffer.h:
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::canUseDiskImageCache): Deleted.
+        (WebCore::CachedImage::useDiskImageCache): Deleted.
+        * loader/cache/CachedImage.h:
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::isUsingDiskImageCache): Deleted.
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::canUseDiskImageCache): Deleted.
+        (WebCore::CachedResource::useDiskImageCache): Deleted.
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::TypeStatistic::addResource):
+        (WebCore::MemoryCache::dumpStats):
+        (WebCore::MemoryCache::dumpLRULists):
+        (WebCore::MemoryCache::flushCachedImagesToDisk): Deleted.
+        * loader/cache/MemoryCache.h:
+        (WebCore::MemoryCache::TypeStatistic::TypeStatistic):
+        * loader/ios/DiskImageCacheClientIOS.h: Removed.
+        * loader/ios/DiskImageCacheIOS.h: Removed.
+        * loader/ios/DiskImageCacheIOS.mm: Removed.
+        * platform/Logging.h:
+        * platform/SharedBuffer.cpp:
+        (WebCore::SharedBuffer::SharedBuffer):
+        (WebCore::SharedBuffer::~SharedBuffer):
+        (WebCore::SharedBuffer::data):
+        (WebCore::SharedBuffer::append):
+        (WebCore::SharedBuffer::buffer):
+        (WebCore::SharedBuffer::getSomeData):
+        (WebCore::SharedBuffer::isAllowedToBeMemoryMapped): Deleted.
+        (WebCore::SharedBuffer::allowToBeMemoryMapped): Deleted.
+        (WebCore::SharedBuffer::failedMemoryMap): Deleted.
+        (WebCore::SharedBuffer::markAsMemoryMapped): Deleted.
+        (WebCore::SharedBuffer::memoryMappedNotificationCallbackData): Deleted.
+        (WebCore::SharedBuffer::memoryMappedNotificationCallback): Deleted.
+        (WebCore::SharedBuffer::setMemoryMappedNotificationCallback): Deleted.
+        * platform/SharedBuffer.h:
+        (WebCore::SharedBuffer::isMemoryMapped): Deleted.
+        * platform/cf/SharedBufferCF.cpp:
+        (WebCore::SharedBuffer::SharedBuffer):
+        * platform/mac/SharedBufferMac.mm:
+        (-[WebCoreSharedBufferData length]):
+        (-[WebCoreSharedBufferData bytes]):
+        (WebCore::SharedBuffer::createCFData):
+        (-[WebCoreSharedBufferData initWithMemoryMappedSharedBuffer:]): Deleted.
+
 2014-09-04  Brian J. Burg  <burg@cs.washington.edu>
 
         LegacyProfiler: ProfileNodes should be used more like structs
index d0a2c68..d21eb3e 100644 (file)
@@ -3021,16 +3021,6 @@ __ZN7WebCore27ScrollingStateScrollingNode24setHorizontalSnapOffsetsERKN3WTF6Vect
 __ZNK7WebCore8Document16annotatedRegionsEv
 #endif
 
-#if ENABLE(DISK_IMAGE_CACHE)
-__ZN7WebCore11MemoryCache23flushCachedImagesToDiskEv
-__ZN7WebCore12SharedBuffer21allowToBeMemoryMappedEv
-__ZN7WebCore12SharedBuffer35setMemoryMappedNotificationCallbackEPFvN3WTF10PassRefPtrIS0_EENS0_16CompletionStatusEPvES5_
-__ZN7WebCore14diskImageCacheEv
-__ZNK7WebCore12SharedBuffer25isAllowedToBeMemoryMappedEv
-__ZNK7WebCore12SharedBuffer32memoryMappedNotificationCallbackEv
-__ZNK7WebCore12SharedBuffer36memoryMappedNotificationCallbackDataEv
-#endif
-
 #if ENABLE(DRAG_SUPPORT)
 __ZN7WebCore12EventHandler17dragSourceEndedAtERKNS_18PlatformMouseEventENS_13DragOperationE
 __ZN7WebCore14DragController10dragExitedERNS_8DragDataE
index d84ce4a..8841b79 100644 (file)
                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */; };
                A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
                A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               A5C566AB127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; };
                A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */; };
                A5E616731894581F009ADF50 /* WebDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */; };
                A5F36D3A18F758720054C024 /* PageScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F36D3818F758720054C024 /* PageScriptDebugServer.cpp */; };
                A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F36D3918F758720054C024 /* PageScriptDebugServer.h */; };
                A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */; };
-               A5F9EF701266750D00FCCF52 /* DiskImageCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */; };
-               A5F9EF711266750D00FCCF52 /* DiskImageCacheIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A6148A6212E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */; };
                A6148A6712E41D940044A784 /* DOMHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */; };
                A6148A6812E41D940044A784 /* DOMHTMLKeygenElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */; };
                A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreakIteratorPoolICU.h; sourceTree = "<group>"; };
                A5AFB34D115151A700B045CB /* StepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StepRange.cpp; sourceTree = "<group>"; };
                A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
-               A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskImageCacheClientIOS.h; sourceTree = "<group>"; };
                A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyEventCocoa.h; sourceTree = "<group>"; };
                A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyEventCocoa.mm; sourceTree = "<group>"; };
                A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; };
                A5F36D3818F758720054C024 /* PageScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageScriptDebugServer.cpp; sourceTree = "<group>"; };
                A5F36D3918F758720054C024 /* PageScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageScriptDebugServer.h; sourceTree = "<group>"; };
                A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autocapitalize.cpp; sourceTree = "<group>"; };
-               A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskImageCacheIOS.mm; sourceTree = "<group>"; };
-               A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskImageCacheIOS.h; sourceTree = "<group>"; };
                A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLKeygenElementInternal.h; sourceTree = "<group>"; };
                A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLKeygenElement.h; sourceTree = "<group>"; };
                A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLKeygenElement.mm; sourceTree = "<group>"; };
                        path = ios;
                        sourceTree = "<group>";
                };
-               CE79D68617F220ED00815C00 /* ios */ = {
-                       isa = PBXGroup;
-                       children = (
-                               A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */,
-                               A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */,
-                               A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */,
-                       );
-                       path = ios;
-                       sourceTree = "<group>";
-               };
                DF9AFD6F13FC31B00015FEB7 /* objc */ = {
                        isa = PBXGroup;
                        children = (
                                D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */,
                                316023F01532C40C00D50FF4 /* Dictionary.h in Headers */,
                                FDAF19991513D131008DB0C3 /* DirectConvolver.h in Headers */,
-                               A5C566AB127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h in Headers */,
-                               A5F9EF711266750D00FCCF52 /* DiskImageCacheIOS.h in Headers */,
                                49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
                                5D8C4DC01428222C0026CE72 /* DisplaySleepDisablerCocoa.h in Headers */,
                                FD31609112B026F700C1A359 /* Distance.h in Headers */,
                                D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */,
                                312D67B11535691F00563D0D /* Dictionary.cpp in Sources */,
                                FDAF19981513D131008DB0C3 /* DirectConvolver.cpp in Sources */,
-                               A5F9EF701266750D00FCCF52 /* DiskImageCacheIOS.mm in Sources */,
                                49FC7A501444AF5F00A5D864 /* DisplayRefreshMonitor.cpp in Sources */,
                                0F97A658155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm in Sources */,
                                49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */,
index be0247a..a6ba8ce 100644 (file)
@@ -119,12 +119,4 @@ RetainPtr<CFDataRef> ResourceBuffer::createCFData()
 }
 #endif
 
-#if ENABLE(DISK_IMAGE_CACHE)
-bool ResourceBuffer::isUsingDiskImageCache() const
-{
-    ASSERT(m_sharedBuffer);
-    return m_sharedBuffer && m_sharedBuffer->isAllowedToBeMemoryMapped();
-}
-#endif
-
 } // namespace WebCore
index 9efea6f..de121e3 100644 (file)
@@ -74,9 +74,6 @@ public:
 #if USE(CF)
     RetainPtr<CFDataRef> createCFData();
 #endif
-#if ENABLE(DISK_IMAGE_CACHE)
-    bool isUsingDiskImageCache() const;
-#endif
 
 protected:
     WEBCORE_EXPORT ResourceBuffer();
index f49d7ad..327ae3f 100644 (file)
 #include "PDFDocumentImage.h"
 #endif
 
-#if ENABLE(DISK_IMAGE_CACHE)
-#include "DiskImageCacheIOS.h"
-#endif
-
 namespace WebCore {
 
 CachedImage::CachedImage(const ResourceRequest& resourceRequest, SessionID sessionID)
@@ -505,40 +501,6 @@ bool CachedImage::currentFrameKnownToBeOpaque(const RenderElement* renderer)
     return image->currentFrameKnownToBeOpaque();
 }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-bool CachedImage::canUseDiskImageCache() const
-{
-    if (isLoading() || errorOccurred())
-        return false;
-
-    if (!m_data)
-        return false;
-
-    if (m_data->size() < diskImageCache().minimumImageSize())
-        return false;
-
-    // "Cache-Control: no-store" resources may be marked as such because they may
-    // contain sensitive information. We should not write these resources to disk.
-    if (m_response.cacheControlContainsNoStore())
-        return false;
-
-    // Testing shows that PDF images did not work when memory mapped.
-    // However, SVG images and Bitmap images were fine. See:
-    // <rdar://problem/8591834> Disk Image Cache should support PDF Images
-    if (m_response.mimeType() == "application/pdf")
-        return false;
-
-    return true;
-}
-
-void CachedImage::useDiskImageCache()
-{
-    ASSERT(canUseDiskImageCache());
-    ASSERT(!isUsingDiskImageCache());
-    m_data->sharedBuffer()->allowToBeMemoryMapped();
-}
-#endif
-
 bool CachedImage::isOriginClean(SecurityOrigin* securityOrigin)
 {
     if (!image()->hasSingleSecurityOrigin())
index 99f5a86..cb4e2a0 100644 (file)
@@ -85,11 +85,6 @@ public:
     bool isManuallyCached() const { return m_isManuallyCached; }
     virtual bool mustRevalidateDueToCacheHeaders(CachePolicy) const;
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    virtual bool canUseDiskImageCache() const override;
-    virtual void useDiskImageCache() override;
-#endif
-
     bool isOriginClean(SecurityOrigin*);
 
 private:
index c3e0929..6858ea4 100644 (file)
@@ -850,13 +850,6 @@ void CachedResource::CachedResourceCallback::timerFired(Timer<CachedResourceCall
     m_resource->didAddClient(m_client);
 }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-bool CachedResource::isUsingDiskImageCache() const
-{
-    return m_data && m_data->isUsingDiskImageCache();
-}
-#endif
-
 #if USE(FOUNDATION)
 void CachedResource::tryReplaceEncodedData(PassRefPtr<SharedBuffer> newBuffer)
 {
index 557a20b..bcb2664 100644 (file)
@@ -247,12 +247,6 @@ public:
     void setLoadFinishTime(double finishTime) { m_loadFinishTime = finishTime; }
     double loadFinishTime() const { return m_loadFinishTime; }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    bool isUsingDiskImageCache() const;
-    virtual bool canUseDiskImageCache() const { return false; }
-    virtual void useDiskImageCache() { ASSERT(canUseDiskImageCache()); }
-#endif
-
     virtual bool canReuse(const ResourceRequest&) const { return true; }
 
 #if USE(FOUNDATION)
index 3804134..9ffb95b 100644 (file)
 #include <wtf/TemporaryChange.h>
 #include <wtf/text/CString.h>
 
-#if ENABLE(DISK_IMAGE_CACHE)
-#include "DiskImageCacheIOS.h"
-#include "ResourceBuffer.h"
-#endif
-
 namespace WebCore {
 
 static const int cDefaultCacheCapacity = 8192 * 1024;
@@ -448,45 +443,6 @@ void MemoryCache::pruneDeadResourcesToSize(unsigned targetSize)
     }
 }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-void MemoryCache::flushCachedImagesToDisk()
-{
-    if (!diskImageCache().isEnabled())
-        return;
-
-#ifndef NDEBUG
-    double start = WTF::currentTimeMS();
-    unsigned resourceCount = 0;
-    unsigned cachedSize = 0;
-#endif
-
-    for (size_t i = m_allResources.size(); i; ) {
-        --i;
-        CachedResource* current = m_allResources[i].m_tail;
-        while (current) {
-            CachedResource* previous = current->m_prevInAllResourcesList;
-
-            if (!current->isUsingDiskImageCache() && current->canUseDiskImageCache()) {
-                current->useDiskImageCache();
-                current->destroyDecodedData();
-#ifndef NDEBUG
-                LOG(DiskImageCache, "Cache::diskCacheResources(): attempting to save (%d) bytes", current->resourceBuffer()->sharedBuffer()->size());
-                ++resourceCount;
-                cachedSize += current->resourceBuffer()->sharedBuffer()->size();
-#endif
-            }
-
-            current = previous;
-        }
-    }
-
-#ifndef NDEBUG
-    double end = WTF::currentTimeMS();
-    LOG(DiskImageCache, "DiskImageCache: took (%f) ms to cache (%d) bytes for (%d) resources", end - start, cachedSize, resourceCount);
-#endif
-}
-#endif // ENABLE(DISK_IMAGE_CACHE)
-
 void MemoryCache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned totalBytes)
 {
     ASSERT(minDeadBytes <= maxDeadBytes);
@@ -845,10 +801,6 @@ void MemoryCache::TypeStatistic::addResource(CachedResource* o)
     size += o->size();
     liveSize += o->hasClients() ? o->size() : 0;
     decodedSize += o->decodedSize();
-#if ENABLE(DISK_IMAGE_CACHE)
-    // Only the data inside the resource was mapped, not the entire resource.
-    mappedSize += o->isUsingDiskImageCache() ? o->resourceBuffer()->sharedBuffer()->size() : 0;
-#endif
 }
 
 MemoryCache::Statistics MemoryCache::getStatistics()
@@ -944,15 +896,9 @@ void MemoryCache::pruneToPercentage(float targetPercentLive)
 void MemoryCache::dumpStats()
 {
     Statistics s = getStatistics();
-#if ENABLE(DISK_IMAGE_CACHE)
-    printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "LiveSize", "DecodedSize", "Mapped", "\"Real\"");
-    printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------");
-    printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Images", s.images.count, s.images.size, s.images.liveSize, s.images.decodedSize, s.images.mappedSize, s.images.size - s.images.mappedSize);
-#else
     printf("%-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "LiveSize", "DecodedSize");
     printf("%-13s %-13s %-13s %-13s %-13s\n", "-------------", "-------------", "-------------", "-------------", "-------------");
     printf("%-13s %13d %13d %13d %13d\n", "Images", s.images.count, s.images.size, s.images.liveSize, s.images.decodedSize);
-#endif
     printf("%-13s %13d %13d %13d %13d\n", "CSS", s.cssStyleSheets.count, s.cssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSize);
 #if ENABLE(XSLT)
     printf("%-13s %13d %13d %13d %13d\n", "XSL", s.xslStyleSheets.count, s.xslStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSize);
@@ -964,11 +910,7 @@ void MemoryCache::dumpStats()
 
 void MemoryCache::dumpLRULists(bool includeLive) const
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced, isMemoryMapped):\n");
-#else
     printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced):\n");
-#endif
 
     int size = m_allResources.size();
     for (int i = size - 1; i >= 0; i--) {
@@ -977,11 +919,7 @@ void MemoryCache::dumpLRULists(bool includeLive) const
         while (current) {
             CachedResource* prev = current->m_prevInAllResourcesList;
             if (includeLive || !current->hasClients())
-#if ENABLE(DISK_IMAGE_CACHE)
-                printf("(%.1fK, %.1fK, %uA, %dR, %d); ", current->decodedSize() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, current->accessCount(), current->hasClients(), current->isUsingDiskImageCache());
-#else
                 printf("(%.1fK, %.1fK, %uA, %dR); ", current->decodedSize() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, current->accessCount(), current->hasClients());
-#endif
 
             current = prev;
         }
index 1b77ff3..d32d774 100644 (file)
@@ -85,19 +85,13 @@ public:
         int size;
         int liveSize;
         int decodedSize;
-#if ENABLE(DISK_IMAGE_CACHE)
-        int mappedSize;
-#endif
 
         TypeStatistic()
             : count(0)
             , size(0)
             , liveSize(0)
             , decodedSize(0)
-#if ENABLE(DISK_IMAGE_CACHE)
-            , mappedSize(0)
-#endif
-        {
+        { 
         }
 
         void addResource(CachedResource*);
@@ -158,10 +152,6 @@ public:
     void addToLiveResourcesSize(CachedResource*);
     void removeFromLiveResourcesSize(CachedResource*);
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    WEBCORE_EXPORT void flushCachedImagesToDisk(); // Flush encoded data from resources still referenced by web pages.
-#endif
-
     static void removeUrlFromCache(ScriptExecutionContext*, const String& urlString, SessionID);
     static void removeRequestFromCache(ScriptExecutionContext*, const ResourceRequest&, SessionID);
     static void removeRequestFromSessionCaches(ScriptExecutionContext*, const ResourceRequest&);
diff --git a/Source/WebCore/loader/ios/DiskImageCacheClientIOS.h b/Source/WebCore/loader/ios/DiskImageCacheClientIOS.h
deleted file mode 100644 (file)
index be91363..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 DiskImageCacheClientIOS_h
-#define DiskImageCacheClientIOS_h
-
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class DiskImageCacheClient : public RefCounted<DiskImageCacheClient> {
-public:
-    virtual ~DiskImageCacheClient() { }
-    virtual void didCreateDiskImageCacheDirectory(const String& directory) = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#endif // DiskImageCacheClientIOS_h
diff --git a/Source/WebCore/loader/ios/DiskImageCacheIOS.h b/Source/WebCore/loader/ios/DiskImageCacheIOS.h
deleted file mode 100644 (file)
index 45e1999..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 DiskImageCacheIOS_h
-#define DiskImageCacheIOS_h
-
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#include "DiskImageCacheClientIOS.h"
-#include "FileSystem.h"
-#include <wtf/HashMap.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Threading.h>
-#include <wtf/text/WTFString.h>
-
-typedef unsigned DiskImageCacheId;
-
-namespace WebCore {
-
-class SharedBuffer;
-
-// Global disk image cache object.
-class DiskImageCache {
-    WTF_MAKE_NONCOPYABLE(DiskImageCache);
-private:
-
-    // Lifetime of this Entry and the SharedBuffer it wraps is managed on the WebThread.
-    class Entry : public RefCounted<Entry> {
-    private:
-        Entry(SharedBuffer*, DiskImageCacheId);
-
-    public:
-        static PassRefPtr<DiskImageCache::Entry> create(SharedBuffer* buffer, DiskImageCacheId id)
-        {
-            return adoptRef(new DiskImageCache::Entry(buffer, id));
-        }
-
-        ~Entry();
-
-        void map(const String& path);
-        void unmap();
-        void removeFile();
-        void clearDataWithoutMapping();
-
-        DiskImageCacheId id() const { return m_id; }
-        unsigned size() const { return m_size; }
-        void* data() const { return m_mapping; }
-        bool isMapped() const { return m_mapping != nullptr; }
-
-    private:
-        bool mapInternal(const String& path);
-        int writeToFileInternal(PlatformFileHandle);
-
-        SharedBuffer* m_buffer;
-        DiskImageCacheId m_id;
-        unsigned m_size;
-        void* m_mapping;
-        String m_path;
-    };
-
-public:
-    DiskImageCache();
-    friend DiskImageCache& diskImageCache();
-    static const DiskImageCacheId invalidDiskCacheId = 0;
-
-    // Write out an item.
-    DiskImageCacheId writeItem(PassRefPtr<SharedBuffer>);
-
-    // Remove item.
-    void removeItem(DiskImageCacheId);
-
-    // Mapping for an item.
-    void* dataForItem(DiskImageCacheId);
-
-    // Setup a client for callbacks.
-    void setClient(PassRefPtr<DiskImageCacheClient> client) { m_client = client; }
-
-    bool isEnabled() const { return m_enabled; }
-    void setEnabled(bool enabled) { m_enabled = enabled; }
-
-    unsigned maximumCacheSize() const { return m_maximumCacheSize; }
-    void setMaximumCacheSize(unsigned maximum) { m_maximumCacheSize = maximum; }
-
-    unsigned minimumImageSize() const { return m_minimumImageSize; }
-    void setMinimumImageSize(unsigned minimum) { m_minimumImageSize = minimum; }
-
-    const String& cacheDirectory() const { return m_cacheDirectory; }
-
-    unsigned size() const { return m_size; }
-    bool isFull() const { return m_size >= m_maximumCacheSize; }
-
-private:
-    ~DiskImageCache() { }
-
-    bool createDirectoryIfNeeded();
-    DiskImageCacheId nextAvailableId();
-
-    String temporaryDirectory();
-    String temporaryFile();
-
-    void updateSize(unsigned delta);
-
-    bool m_enabled;
-    unsigned m_size;
-    unsigned m_maximumCacheSize;
-    unsigned m_minimumImageSize;
-    DiskImageCacheId m_nextAvailableId;
-    String m_cacheDirectory;
-
-    RefPtr<DiskImageCacheClient> m_client;
-    HashMap<DiskImageCacheId, RefPtr<DiskImageCache::Entry>> m_table;
-
-    Mutex m_mutex;
-};
-
-// Function to obtain the global disk image cache.
-WEBCORE_EXPORT DiskImageCache& diskImageCache();
-
-} // namespace WebCore
-
-#endif // ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#endif // DiskImageCacheIOS_h
diff --git a/Source/WebCore/loader/ios/DiskImageCacheIOS.mm b/Source/WebCore/loader/ios/DiskImageCacheIOS.mm
deleted file mode 100644 (file)
index 910f64d..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "DiskImageCacheIOS.h"
-
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#include "FileSystemIOS.h"
-#include "Logging.h"
-#include "SharedBuffer.h"
-#include "WebCoreThread.h"
-#include "WebCoreThreadRun.h"
-#include <errno.h>
-#include <sys/mman.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-DiskImageCache& diskImageCache()
-{
-    static NeverDestroyed<DiskImageCache> cache;
-    return cache;
-}
-
-DiskImageCache::Entry::Entry(SharedBuffer* buffer, DiskImageCacheId id)
-    : m_buffer(buffer)
-    , m_id(id)
-    , m_size(0)
-    , m_mapping(nullptr)
-{
-    ASSERT(WebThreadIsCurrent());
-    ASSERT(WebThreadIsLocked());
-    ASSERT(m_buffer);
-    m_buffer->ref();
-}
-
-DiskImageCache::Entry::~Entry()
-{
-    ASSERT(WebThreadIsCurrent());
-    ASSERT(WebThreadIsLocked());
-    ASSERT(!m_buffer);
-    ASSERT(!m_mapping);
-}
-
-bool DiskImageCache::Entry::mapInternal(const String& path)
-{
-    ASSERT(m_buffer);
-    ASSERT(!m_mapping);
-
-    m_path = path;
-    m_size = m_buffer->size();
-
-    // Open the file for reading and writing.
-    PlatformFileHandle handle = open(m_path.utf8().data(), O_CREAT | O_RDWR | O_TRUNC, static_cast<mode_t>(0600));
-    if (!isHandleValid(handle))
-        return false;
-
-    // Write the data to the file.
-    if (writeToFileInternal(handle) == -1) {
-        closeFile(handle);
-        deleteFile(m_path);
-        return false;
-    }
-
-    // Seek back to the beginning.
-    if (seekFile(handle, 0, SeekFromBeginning) == -1) {
-        closeFile(handle);
-        deleteFile(m_path);
-        return false;
-    }
-
-    // Perform memory mapping for reading.
-    // NOTE: This must not conflict with the open() above, which must also open for reading.
-    m_mapping = mmap(nullptr, m_size, PROT_READ, MAP_SHARED, handle, 0);
-    closeFile(handle);
-    if (m_mapping == MAP_FAILED) {
-        LOG(DiskImageCache, "DiskImageCache: mapping failed (%d): (%s)", errno, strerror(errno));
-        m_mapping = nullptr;
-        deleteFile(m_path);
-        return false;
-    }
-
-    return true;
-}
-
-void DiskImageCache::Entry::map(const String& path)
-{
-    ASSERT(m_buffer);
-    ASSERT(!m_mapping);
-    DiskImageCache::Entry* thisEntry = this;
-
-    bool fileMapped = mapInternal(path);
-    if (!fileMapped) {
-        // Notify the buffer in the case of a failed mapping.
-        WebThreadRun(^{
-            m_buffer->failedMemoryMap();
-            m_buffer->deref();
-            m_buffer = 0;
-            thisEntry->deref();
-        });
-        return;
-    }
-
-    // Notify the buffer in the case of a successful mapping.
-    // This should happen on the WebThread because this is being run
-    // asynchronously inside a dispatch queue.
-    WebThreadRun(^{
-        m_buffer->markAsMemoryMapped();
-        m_buffer->deref();
-        m_buffer = 0;
-        thisEntry->deref();
-    });
-}
-
-void DiskImageCache::Entry::unmap()
-{
-    if (!m_mapping) {
-        ASSERT(!m_size);
-        return;
-    }
-
-    if (munmap(m_mapping, m_size) == -1)
-        LOG_ERROR("DiskImageCache: Could not munmap a memory mapped file with id (%d)", m_id);
-
-    m_mapping = nullptr;
-    m_size = 0;
-}
-
-void DiskImageCache::Entry::removeFile()
-{
-    ASSERT(!m_mapping);
-    ASSERT(!m_size);
-
-    if (!deleteFile(m_path))
-        LOG_ERROR("DiskImageCache: Could not delete memory mapped file (%s)", m_path.utf8().data());
-}
-
-void DiskImageCache::Entry::clearDataWithoutMapping()
-{
-    ASSERT(!m_mapping);
-    ASSERT(m_buffer);
-    m_buffer->deref();
-    m_buffer = 0;
-}
-
-int DiskImageCache::Entry::writeToFileInternal(PlatformFileHandle handle)
-{
-    ASSERT(m_buffer);
-    int totalBytesWritten = 0;
-
-    const char* segment = nullptr;
-    unsigned position = 0;
-    while (unsigned length = m_buffer->getSomeData(segment, position)) {
-        int bytesWritten = writeToFile(handle, segment, length);
-        if (bytesWritten == -1)
-            return -1;
-
-        totalBytesWritten += bytesWritten;
-        position += length;
-    }
-
-    return totalBytesWritten;
-}
-
-
-DiskImageCache::DiskImageCache()
-    : m_enabled(false)
-    , m_size(0)
-    , m_maximumCacheSize(100 * 1024 * 1024)
-    , m_minimumImageSize(100 * 1024)
-    , m_nextAvailableId(DiskImageCache::invalidDiskCacheId + 1)
-{
-}
-
-DiskImageCacheId DiskImageCache::writeItem(PassRefPtr<SharedBuffer> item)
-{
-    if (!isEnabled() || !createDirectoryIfNeeded())
-        return DiskImageCache::invalidDiskCacheId;
-
-    // We are already full, cannot add anything until something is removed.
-    if (isFull()) {
-        LOG(DiskImageCache, "DiskImageCache: could not process an item because the cache was full at (%d). The \"max\" being (%d)", m_size, m_maximumCacheSize);
-        return DiskImageCache::invalidDiskCacheId;
-    }
-
-    // Create an entry.
-    DiskImageCacheId id = nextAvailableId();
-    RefPtr<SharedBuffer> buffer = item;
-    RefPtr<DiskImageCache::Entry> entry = DiskImageCache::Entry::create(buffer.get(), id);
-    m_table.add(id, entry);
-
-    // Create a temporary file path.
-    String path = temporaryFile();
-    LOG(DiskImageCache, "DiskImageCache: creating entry (%d) at (%s)", id, path.utf8().data());
-    if (path.isNull())
-        return DiskImageCache::invalidDiskCacheId;
-
-    // The lifetime of the Entry is handled on the WebThread.
-    // Before we send to a dispatch queue we need to ref so
-    // that we are sure the object still exists. This call
-    // is balanced in the WebThreadRun inside of Entry::map.
-    // or the early return in this dispatch.
-    DiskImageCache::Entry* localEntryForBlock = entry.get();
-    localEntryForBlock->ref();
-
-    // Map to disk asynchronously.
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        // The cache became full since the time we were added to the queue. Don't map.
-        if (diskImageCache().isFull()) {
-            WebThreadRun(^{
-                localEntryForBlock->clearDataWithoutMapping();
-                localEntryForBlock->deref();
-            });
-            return;
-        }
-
-        localEntryForBlock->map(path);
-
-        // Update the size on a successful mapping.
-        if (localEntryForBlock->isMapped())
-            diskImageCache().updateSize(localEntryForBlock->size());
-    });
-
-    return id;
-}
-
-void DiskImageCache::updateSize(unsigned delta)
-{
-    MutexLocker lock(m_mutex);
-    m_size += delta;
-}
-
-void DiskImageCache::removeItem(DiskImageCacheId id)
-{
-    LOG(DiskImageCache, "DiskImageCache: removeItem (%d)", id);
-    RefPtr<DiskImageCache::Entry> entry = m_table.get(id);
-    m_table.remove(id);
-    if (!entry->isMapped())
-        return;
-
-    updateSize(-(entry->size()));
-
-    DiskImageCache::Entry *localEntryForBlock = entry.get();
-    localEntryForBlock->ref();
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        localEntryForBlock->unmap();
-        localEntryForBlock->removeFile();
-        WebThreadRun(^{ localEntryForBlock->deref(); });
-    });
-}
-
-void* DiskImageCache::dataForItem(DiskImageCacheId id)
-{
-    ASSERT(id);
-
-    RefPtr<DiskImageCache::Entry> entry = m_table.get(id);
-    ASSERT(entry->isMapped());
-    return entry->data();
-}
-
-bool DiskImageCache::createDirectoryIfNeeded()
-{
-    if (!m_cacheDirectory.isNull())
-        return true;
-
-    m_cacheDirectory = temporaryDirectory();
-    LOG(DiskImageCache, "DiskImageCache: Created temporary directory (%s)", m_cacheDirectory.utf8().data());
-    if (m_cacheDirectory.isNull()) {
-        LOG_ERROR("DiskImageCache: could not create cache directory");
-        return false;
-    }
-
-    if (m_client)
-        m_client->didCreateDiskImageCacheDirectory(m_cacheDirectory);
-
-    return true;
-}
-
-DiskImageCacheId DiskImageCache::nextAvailableId()
-{
-    return m_nextAvailableId++;
-}
-
-String DiskImageCache::temporaryDirectory()
-{
-    NSString *tempDiskCacheDirectory = createTemporaryDirectory(@"DiskImageCache");
-    if (!tempDiskCacheDirectory)
-        LOG_ERROR("DiskImageCache: Could not create a temporary directory.");
-
-    return tempDiskCacheDirectory;
-}
-
-String DiskImageCache::temporaryFile()
-{
-    NSString *tempFile = createTemporaryFile(m_cacheDirectory, @"tmp");
-    if (!tempFile)
-        LOG_ERROR("DiskImageCache: Could not create a temporary file.");
-
-    return tempFile;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
index 52593a6..486de2b 100644 (file)
@@ -42,7 +42,6 @@ namespace WebCore {
     M(Archives) \
     M(BackForward) \
     M(Compositing) \
-    M(DiskImageCache) \
     M(Editing) \
     M(Events) \
     M(FTP) \
index a6d6233..d110e0b 100644 (file)
 #include <wtf/PassOwnPtr.h>
 #include <wtf/unicode/UTF8.h>
 
-#if ENABLE(DISK_IMAGE_CACHE)
-#include "DiskImageCacheIOS.h"
-#endif
-
 namespace WebCore {
 
 #if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
@@ -66,36 +62,18 @@ static inline void freeSegment(char* p)
 SharedBuffer::SharedBuffer()
     : m_size(0)
     , m_buffer(adoptRef(new DataBuffer))
-#if ENABLE(DISK_IMAGE_CACHE)
-    , m_isMemoryMapped(false)
-    , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
-    , m_notifyMemoryMappedCallback(nullptr)
-    , m_notifyMemoryMappedCallbackData(nullptr)
-#endif
 {
 }
 
 SharedBuffer::SharedBuffer(unsigned size)
     : m_size(size)
     , m_buffer(adoptRef(new DataBuffer))
-#if ENABLE(DISK_IMAGE_CACHE)
-    , m_isMemoryMapped(false)
-    , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
-    , m_notifyMemoryMappedCallback(nullptr)
-    , m_notifyMemoryMappedCallbackData(nullptr)
-#endif
 {
 }
 
 SharedBuffer::SharedBuffer(const char* data, unsigned size)
     : m_size(0)
     , m_buffer(adoptRef(new DataBuffer))
-#if ENABLE(DISK_IMAGE_CACHE)
-    , m_isMemoryMapped(false)
-    , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
-    , m_notifyMemoryMappedCallback(nullptr)
-    , m_notifyMemoryMappedCallbackData(nullptr)
-#endif
 {
     append(data, size);
 }
@@ -103,25 +81,12 @@ SharedBuffer::SharedBuffer(const char* data, unsigned size)
 SharedBuffer::SharedBuffer(const unsigned char* data, unsigned size)
     : m_size(0)
     , m_buffer(adoptRef(new DataBuffer))
-#if ENABLE(DISK_IMAGE_CACHE)
-    , m_isMemoryMapped(false)
-    , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
-    , m_notifyMemoryMappedCallback(nullptr)
-    , m_notifyMemoryMappedCallbackData(nullptr)
-#endif
 {
     append(reinterpret_cast<const char*>(data), size);
 }
     
 SharedBuffer::~SharedBuffer()
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    if (m_diskImageCacheId) {
-        diskImageCache().removeItem(m_diskImageCacheId);
-        m_isMemoryMapped = false;
-        m_diskImageCacheId = DiskImageCache::invalidDiskCacheId;
-    }
-#endif
     clear();
 }
 
@@ -141,72 +106,8 @@ unsigned SharedBuffer::size() const
     return m_size;
 }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-bool SharedBuffer::isAllowedToBeMemoryMapped() const
-{
-    return m_diskImageCacheId != DiskImageCache::invalidDiskCacheId;
-}
-
-SharedBuffer::MemoryMappingState SharedBuffer::allowToBeMemoryMapped()
-{
-    if (isMemoryMapped())
-        return SharedBuffer::SuccessAlreadyMapped;
-
-    if (isAllowedToBeMemoryMapped())
-        return SharedBuffer::PreviouslyQueuedForMapping;
-
-    m_diskImageCacheId = diskImageCache().writeItem(this);
-    if (m_diskImageCacheId == DiskImageCache::invalidDiskCacheId)
-        return SharedBuffer::FailureCacheFull;
-
-    return SharedBuffer::QueuedForMapping;
-}
-
-void SharedBuffer::failedMemoryMap()
-{
-    if (m_notifyMemoryMappedCallback)
-        m_notifyMemoryMappedCallback(this, SharedBuffer::Failed, m_notifyMemoryMappedCallbackData);
-}
-
-void SharedBuffer::markAsMemoryMapped()
-{
-    ASSERT(!isMemoryMapped());
-
-    m_isMemoryMapped = true;
-    unsigned savedSize = size();
-    clear();
-    m_size = savedSize;
-
-    if (m_notifyMemoryMappedCallback)
-        m_notifyMemoryMappedCallback(this, SharedBuffer::Succeeded, m_notifyMemoryMappedCallbackData);
-}
-
-SharedBuffer::MemoryMappedNotifyCallbackData SharedBuffer::memoryMappedNotificationCallbackData() const
-{
-    return m_notifyMemoryMappedCallbackData;
-}
-
-SharedBuffer::MemoryMappedNotifyCallback SharedBuffer::memoryMappedNotificationCallback() const
-{
-    return m_notifyMemoryMappedCallback;
-}
-
-void SharedBuffer::setMemoryMappedNotificationCallback(MemoryMappedNotifyCallback callback, MemoryMappedNotifyCallbackData data)
-{
-    ASSERT(!m_notifyMemoryMappedCallback || !callback);
-    ASSERT(!m_notifyMemoryMappedCallbackData || !data);
-
-    m_notifyMemoryMappedCallback = callback;
-    m_notifyMemoryMappedCallbackData = data;
-}
-#endif
-
 const char* SharedBuffer::data() const
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    if (isMemoryMapped())
-        return static_cast<const char*>(diskImageCache().dataForItem(m_diskImageCacheId));
-#endif
 
     if (hasPlatformData())
         return platformData();
@@ -258,9 +159,6 @@ void SharedBuffer::append(SharedBuffer* data)
 
 void SharedBuffer::append(const char* data, unsigned length)
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    ASSERT(!isMemoryMapped());
-#endif
     if (!length)
         return;
 
@@ -393,9 +291,6 @@ void SharedBuffer::copyBufferAndClear(char* destination, unsigned bytesToCopy) c
 
 const Vector<char>& SharedBuffer::buffer() const
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    ASSERT(!isMemoryMapped());
-#endif
     unsigned bufferSize = m_buffer->data.size();
     if (m_size > bufferSize) {
         duplicateDataBufferIfNecessary();
@@ -413,15 +308,6 @@ unsigned SharedBuffer::getSomeData(const char*& someData, unsigned position) con
         return 0;
     }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    ASSERT(position < size());
-    if (isMemoryMapped()) {
-        const char* data = static_cast<const char*>(diskImageCache().dataForItem(m_diskImageCacheId));
-        someData = data + position;
-        return size() - position;
-    }
-#endif
-
     if (hasPlatformData()) {
         ASSERT_WITH_SECURITY_IMPLICATION(position < size());
         someData = data() + position;
index 859d4b5..ccb029d 100644 (file)
@@ -118,30 +118,6 @@ public:
     //      }
     WEBCORE_EXPORT unsigned getSomeData(const char*& data, unsigned position = 0) const;
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    enum MemoryMappingState { QueuedForMapping, PreviouslyQueuedForMapping, SuccessAlreadyMapped, FailureCacheFull };
-
-    // Calling this will cause this buffer to be memory mapped.
-    WEBCORE_EXPORT MemoryMappingState allowToBeMemoryMapped();
-    WEBCORE_EXPORT bool isAllowedToBeMemoryMapped() const;
-
-    // This is called to indicate that the memory mapping failed.
-    void failedMemoryMap();
-
-    // This is called only once the buffer has been completely memory mapped.
-    void markAsMemoryMapped();
-    bool isMemoryMapped() const { return m_isMemoryMapped; }
-
-    // This callback function will be called when either the buffer has been memory mapped or failed to be memory mapped.
-    enum CompletionStatus { Failed, Succeeded };
-    typedef void* MemoryMappedNotifyCallbackData;
-    typedef void (*MemoryMappedNotifyCallback)(PassRefPtr<SharedBuffer>, CompletionStatus, MemoryMappedNotifyCallbackData);
-
-    WEBCORE_EXPORT MemoryMappedNotifyCallbackData memoryMappedNotificationCallbackData() const;
-    WEBCORE_EXPORT MemoryMappedNotifyCallback memoryMappedNotificationCallback() const;
-    WEBCORE_EXPORT void setMemoryMappedNotificationCallback(MemoryMappedNotifyCallback, MemoryMappedNotifyCallbackData);
-#endif
-
     void tryReplaceContentsWithPlatformBuffer(SharedBuffer*);
     WEBCORE_EXPORT bool hasPlatformData() const;
 
@@ -182,12 +158,6 @@ private:
 #else
     mutable Vector<char*> m_segments;
 #endif
-#if ENABLE(DISK_IMAGE_CACHE)
-    bool m_isMemoryMapped;
-    unsigned m_diskImageCacheId; // DiskImageCacheId is unsigned.
-    MemoryMappedNotifyCallback m_notifyMemoryMappedCallback;
-    MemoryMappedNotifyCallbackData m_notifyMemoryMappedCallbackData;
-#endif
 #if USE(CF)
     explicit SharedBuffer(CFDataRef);
     RetainPtr<CFDataRef> m_cfData;
index 7811625..ac19870 100644 (file)
 
 #include <wtf/cf/TypeCasts.h>
 
-#if ENABLE(DISK_IMAGE_CACHE)
-#include "DiskImageCacheIOS.h"
-#endif
-
 namespace WebCore {
 
 SharedBuffer::SharedBuffer(CFDataRef cfData)
     : m_size(0)
     , m_buffer(adoptRef(new DataBuffer))
-#if ENABLE(DISK_IMAGE_CACHE)
-    , m_isMemoryMapped(false)
-    , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
-    , m_notifyMemoryMappedCallback(nullptr)
-    , m_notifyMemoryMappedCallbackData(nullptr)
-#endif
     , m_cfData(cfData)
 {
 }
@@ -128,12 +118,6 @@ PassRefPtr<SharedBuffer> SharedBuffer::wrapCFDataArray(CFArrayRef cfDataArray)
 SharedBuffer::SharedBuffer(CFArrayRef cfDataArray)
     : m_size(0)
     , m_buffer(adoptRef(new DataBuffer))
-#if ENABLE(DISK_IMAGE_CACHE)
-    , m_isMemoryMapped(false)
-    , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
-    , m_notifyMemoryMappedCallback(nullptr)
-    , m_notifyMemoryMappedCallbackData(nullptr)
-#endif
     , m_cfData(nullptr)
 {
     CFIndex dataArrayCount = CFArrayGetCount(cfDataArray);
index e78e38b..ea482f0 100644 (file)
@@ -37,15 +37,9 @@ using namespace WebCore;
 @interface WebCoreSharedBufferData : NSData
 {
     RefPtr<SharedBuffer::DataBuffer> sharedBufferDataBuffer;
-#if ENABLE(DISK_IMAGE_CACHE)
-    RefPtr<SharedBuffer> sharedBuffer;
-#endif
 }
 
 - (id)initWithSharedBufferDataBuffer:(SharedBuffer::DataBuffer*)dataBuffer;
-#if ENABLE(DISK_IMAGE_CACHE)
-- (id)initWithMemoryMappedSharedBuffer:(SharedBuffer&)memoryMappedSharedBuffer;
-#endif
 @end
 
 @implementation WebCoreSharedBufferData
@@ -82,35 +76,13 @@ using namespace WebCore;
     return self;
 }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-- (id)initWithMemoryMappedSharedBuffer:(SharedBuffer&)memoryMappedSharedBuffer
-{
-    ASSERT(memoryMappedSharedBuffer.isMemoryMapped());
-    self = [super init];
-
-    if (!self)
-        return nil;
-
-    sharedBuffer = &memoryMappedSharedBuffer;
-    return self;
-}
-#endif
-
 - (NSUInteger)length
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    if (sharedBuffer)
-        return sharedBuffer->size();
-#endif
     return sharedBufferDataBuffer->data.size();
 }
 
 - (const void *)bytes
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    if (sharedBuffer)
-        return sharedBuffer->data();
-#endif
     return sharedBufferDataBuffer->data.data();
 }
 
@@ -146,11 +118,6 @@ RetainPtr<CFDataRef> SharedBuffer::createCFData()
     if (CFDataRef cfData = existingCFData())
         return cfData;
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    if (isMemoryMapped())
-        return adoptCF((CFDataRef)adoptNS([[WebCoreSharedBufferData alloc] initWithMemoryMappedSharedBuffer:*this]).leakRef());
-#endif
-
     data(); // Force data into m_buffer from segments or data array.
     return adoptCF((CFDataRef)adoptNS([[WebCoreSharedBufferData alloc] initWithSharedBufferDataBuffer:m_buffer.get()]).leakRef());
 }
index 2ae90b8..1cf93e1 100644 (file)
@@ -1,3 +1,15 @@
+2014-09-04  Pratik Solanki  <psolanki@apple.com>
+
+        Remove iOS specific disk image cache
+        https://bugs.webkit.org/show_bug.cgi?id=136517
+
+        Reviewed by Antti Koivisto.
+
+        Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
+        this now since we don't enable it in WebKit2 on iOS.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
 2014-08-29  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviwed, remove empty directories.
index cea173c..94c4a07 100644 (file)
                A10C1D631820300E0036883A /* WebCaretChangeListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A10C1D491820300E0036883A /* WebCaretChangeListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A10C1D641820300E0036883A /* WebChromeClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A10C1D4A1820300E0036883A /* WebChromeClientIOS.h */; };
                A10C1D651820300E0036883A /* WebChromeClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10C1D4B1820300E0036883A /* WebChromeClientIOS.mm */; };
-               A10C1D661820300E0036883A /* WebDiskImageCacheClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A10C1D4C1820300E0036883A /* WebDiskImageCacheClientIOS.h */; };
-               A10C1D671820300E0036883A /* WebDiskImageCacheClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10C1D4D1820300E0036883A /* WebDiskImageCacheClientIOS.mm */; };
                A10C1D681820300E0036883A /* WebFixedPositionContent.h in Headers */ = {isa = PBXBuildFile; fileRef = A10C1D4E1820300E0036883A /* WebFixedPositionContent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A10C1D691820300E0036883A /* WebFixedPositionContent.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10C1D4F1820300E0036883A /* WebFixedPositionContent.mm */; };
                A10C1D6A1820300E0036883A /* WebFixedPositionContentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A10C1D501820300E0036883A /* WebFixedPositionContentInternal.h */; };
                A10C1D491820300E0036883A /* WebCaretChangeListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCaretChangeListener.h; path = ios/WebCoreSupport/WebCaretChangeListener.h; sourceTree = SOURCE_ROOT; };
                A10C1D4A1820300E0036883A /* WebChromeClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebChromeClientIOS.h; path = ios/WebCoreSupport/WebChromeClientIOS.h; sourceTree = SOURCE_ROOT; };
                A10C1D4B1820300E0036883A /* WebChromeClientIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebChromeClientIOS.mm; path = ios/WebCoreSupport/WebChromeClientIOS.mm; sourceTree = SOURCE_ROOT; };
-               A10C1D4C1820300E0036883A /* WebDiskImageCacheClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebDiskImageCacheClientIOS.h; path = ios/WebCoreSupport/WebDiskImageCacheClientIOS.h; sourceTree = SOURCE_ROOT; };
-               A10C1D4D1820300E0036883A /* WebDiskImageCacheClientIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebDiskImageCacheClientIOS.mm; path = ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm; sourceTree = SOURCE_ROOT; };
                A10C1D4E1820300E0036883A /* WebFixedPositionContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebFixedPositionContent.h; path = ios/WebCoreSupport/WebFixedPositionContent.h; sourceTree = SOURCE_ROOT; };
                A10C1D4F1820300E0036883A /* WebFixedPositionContent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebFixedPositionContent.mm; path = ios/WebCoreSupport/WebFixedPositionContent.mm; sourceTree = SOURCE_ROOT; };
                A10C1D501820300E0036883A /* WebFixedPositionContentInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebFixedPositionContentInternal.h; path = ios/WebCoreSupport/WebFixedPositionContentInternal.h; sourceTree = SOURCE_ROOT; };
                                A10C1D491820300E0036883A /* WebCaretChangeListener.h */,
                                A10C1D4A1820300E0036883A /* WebChromeClientIOS.h */,
                                A10C1D4B1820300E0036883A /* WebChromeClientIOS.mm */,
-                               A10C1D4C1820300E0036883A /* WebDiskImageCacheClientIOS.h */,
-                               A10C1D4D1820300E0036883A /* WebDiskImageCacheClientIOS.mm */,
                                A10C1D4E1820300E0036883A /* WebFixedPositionContent.h */,
                                A10C1D4F1820300E0036883A /* WebFixedPositionContent.mm */,
                                A10C1D501820300E0036883A /* WebFixedPositionContentInternal.h */,
                                7C01CB85173435C900C5D807 /* PopupMenuMac.h in Headers */,
                                A10C1D1E18202F9C0036883A /* WebDefaultUIKitDelegate.h in Headers */,
                                1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,
-                               A10C1D661820300E0036883A /* WebDiskImageCacheClientIOS.h in Headers */,
                                E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */,
                                7C01CB87173435C900C5D807 /* SearchPopupMenuMac.h in Headers */,
                                A10C1D6F1820300E0036883A /* WebGeolocationInternal.h in Headers */,
                                939811130824BF01008DF038 /* WebHistory.mm in Sources */,
                                939810BD0824BF01008DF038 /* WebHistoryItem.mm in Sources */,
                                1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */,
-                               A10C1D671820300E0036883A /* WebDiskImageCacheClientIOS.mm in Sources */,
                                939810F30824BF01008DF038 /* WebHTMLRepresentation.mm in Sources */,
                                939810F40824BF01008DF038 /* WebHTMLView.mm in Sources */,
                                A10C1D7F1820303D0036883A /* WebFrameViewWAKCompatibility.m in Sources */,
index e464e66..465c013 100644 (file)
@@ -1,3 +1,20 @@
+2014-09-04  Pratik Solanki  <psolanki@apple.com>
+
+        Remove iOS specific disk image cache
+        https://bugs.webkit.org/show_bug.cgi?id=136517
+
+        Reviewed by Antti Koivisto.
+
+        Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
+        this now since we don't enable it in WebKit2 on iOS.
+
+        * WebCoreSupport/WebDiskImageCacheClientIOS.h: Removed.
+        * WebCoreSupport/WebDiskImageCacheClientIOS.mm: Removed.
+        * WebView/WebPDFViewPlaceholder.mm:
+        (-[WebPDFViewPlaceholder finishedLoadingWithDataSource:]):
+        (-[WebPDFViewPlaceholder dataSourceMemoryMapped]): Deleted.
+        (-[WebPDFViewPlaceholder dataSourceMemoryMapFailed]): Deleted.
+
 2014-08-31  Tim Horton  <timothy_horton@apple.com>
 
         Remove unnecessary (and unnecessarily iOS-specific) setStrokeAndFillColor
diff --git a/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h b/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h
deleted file mode 100644 (file)
index ea21601..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#import <WebCore/DiskImageCacheClientIOS.h>
-
-class WebDiskImageCacheClient final : public WebCore::DiskImageCacheClient {
-public:
-    static PassRefPtr<WebDiskImageCacheClient> create() { return adoptRef(new WebDiskImageCacheClient()); }
-private:
-    virtual void didCreateDiskImageCacheDirectory(const WTF::String& directory) override;
-};
-
-void WebKitInitializeWebDiskImageCache();
-
-#endif
diff --git a/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm b/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm
deleted file mode 100644 (file)
index 8a5d28e..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-#import "WebDiskImageCacheClientIOS.h"
-
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
-#import "WebPreferences.h"
-#import "WebPreferencesPrivate.h"
-#import <WebCore/DiskImageCacheIOS.h>
-#import <sys/param.h>
-
-using namespace WebCore;
-
-void WebDiskImageCacheClient::didCreateDiskImageCacheDirectory(const WTF::String& directory)
-{
-    // Set the NSFileProtectionComplete attribute on the directory so that its contents are inaccessible when the device is locked.
-    NSError *error = nil;
-    NSString *directoryPath = directory;
-    NSDictionary *attributes = @{NSFileProtectionKey: NSFileProtectionComplete};
-    if (![[NSFileManager defaultManager] setAttributes:attributes ofItemAtPath:directoryPath error:&error])
-        NSLog(@"DiskImageCache: Failed to set attributes on disk image cache directory: %@", error);
-
-    WebPreferences *standardPreferences = [WebPreferences standardPreferences];
-    ASSERT(![[standardPreferences _diskImageCacheSavedCacheDirectory] length]);
-    [standardPreferences _setDiskImageCacheSavedCacheDirectory:directory];
-}
-
-static void removeOldDiskImageCacheDirectory()
-{
-    WebPreferences *standardPreferences = [WebPreferences standardPreferences];
-    NSString *oldDirectory = [standardPreferences _diskImageCacheSavedCacheDirectory];
-    [standardPreferences _setDiskImageCacheSavedCacheDirectory:@""];
-
-    if (![oldDirectory length])
-        return;
-
-    const char* oldDirectoryCString = [oldDirectory fileSystemRepresentation];
-    const size_t length = strlen(oldDirectoryCString) + 1; // For NULL terminator.
-    ASSERT(length < MAXPATHLEN);
-    if (length >= MAXPATHLEN)
-        return;
-
-    // This deletes whatever directory was named in the user defaults key.
-    // To be safe, we resolve the absolute path, and verify that the
-    // last path component starts with "DiskImageCache".
-
-    // Resolve the old directory path to an absolute path.
-    Vector<char, MAXPATHLEN> path(length);
-    memcpy(path.data(), oldDirectoryCString, length);
-    char absolutePath[MAXPATHLEN];
-    if (!realpath(path.data(), absolutePath)) {
-        NSLog(@"DiskImageCache: Could not resolve the absolute path of the old directory.");
-        return;
-    }
-
-    // Verify the last path component starts with "DiskImageCache".
-    const size_t absoluteLength = strlen(absolutePath);
-    NSString *resolvedAbsolutePath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:absolutePath length:absoluteLength];
-    NSString *prefix = @"DiskImageCache";
-    if (![[resolvedAbsolutePath lastPathComponent] hasPrefix:prefix]) {
-        NSLog(@"DiskImageCache: The old directory did not start with the proper prefix.");
-        return;
-    }
-
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        NSError *error;
-        if (![[NSFileManager defaultManager] removeItemAtPath:oldDirectory error:&error])
-            NSLog(@"DiskImageCache: Failed to Remove Old Directory: %@", [error localizedFailureReason]);
-    });
-}
-
-void WebKitInitializeWebDiskImageCache()
-{
-    static bool initialized = false;
-    if (initialized)
-        return;
-    initialized = true;
-
-    removeOldDiskImageCacheDirectory();
-
-    RefPtr<WebDiskImageCacheClient> sharedClient = WebDiskImageCacheClient::create();
-    diskImageCache().setClient(sharedClient.release());
-}
-
-#endif // ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
index 4b52127..1ddfe03 100644 (file)
@@ -249,32 +249,6 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f;
 {
 }
 
-#pragma mark WebDataSourcePrivateDelegate protocol
-
-#if ENABLE(DISK_IMAGE_CACHE)
-- (void)dataSourceMemoryMapped
-{
-    _didFinishLoadAndMemoryMap = YES;
-
-    CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)[_dataSource data]);
-    if (!provider)
-        return;
-
-    _document = CGPDFDocumentCreateWithProvider(provider);
-
-    // Dump the data provider as soon as possible since the CGPDFDocument will not hold onto it.
-    CGDataProviderRelease(provider);
-
-    [self _doPostLoadOrUnlockTasks];
-}
-
-- (void)dataSourceMemoryMapFailed
-{
-    // Nothing we can do about this, just do what we would normally do in memory.
-    [self dataSourceMemoryMapped];
-}
-#endif
-
 #pragma mark WebDocumentRepresentation protocol
 
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
@@ -302,13 +276,6 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f;
 - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
 {
     [self dataSourceUpdated:dataSource];
-
-#if ENABLE(DISK_IMAGE_CACHE)
-    [dataSource setDataSourceDelegate:(NSObject<WebDataSourcePrivateDelegate> *)self];
-    [dataSource _setAllowToBeMemoryMapped];
-#else
-    [self dataSourceMemoryMapped];
-#endif
 }
 
 - (BOOL)canProvideDocumentSource
index 72f2fc9..87a7552 100644 (file)
@@ -1,3 +1,38 @@
+2014-09-04  Pratik Solanki  <psolanki@apple.com>
+
+        Remove iOS specific disk image cache
+        https://bugs.webkit.org/show_bug.cgi?id=136517
+
+        Reviewed by Antti Koivisto.
+
+        Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
+        this now since we don't enable it in WebKit2 on iOS.
+
+        * Misc/WebCache.mm:
+        (+[WebCache statistics]):
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource _setAllowToBeMemoryMapped]):
+        (-[WebDataSource setDataSourceDelegate:]):
+        (-[WebDataSource dataSourceDelegate]):
+        (-[WebDataSource dealloc]):
+        (BufferMemoryMapped): Deleted.
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences diskImageCacheEnabled]): Deleted.
+        (-[WebPreferences setDiskImageCacheEnabled:]): Deleted.
+        (-[WebPreferences diskImageCacheMinimumImageSize]): Deleted.
+        (-[WebPreferences setDiskImageCacheMinimumImageSize:]): Deleted.
+        (-[WebPreferences diskImageCacheMaximumCacheSize]): Deleted.
+        (-[WebPreferences setDiskImageCacheMaximumCacheSize:]): Deleted.
+        (-[WebPreferences _diskImageCacheSavedCacheDirectory]): Deleted.
+        (-[WebPreferences _setDiskImageCacheSavedCacheDirectory:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (+[WebView _handleMemoryWarning]):
+        (-[WebView _preferencesChanged:]):
+
 2014-09-04  Daniel Bates  <dabates@apple.com>
 
         [iOS] Make iOS build when ENABLE_TOUCH_EVENT and ENABLE_IOS_TOUCH_EVENTS disabled
index 61f6c1e..9432a91 100644 (file)
 #endif
             [NSNumber numberWithInt:s.scripts.decodedSize], @"JavaScript",
             nil],
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-        [NSDictionary dictionaryWithObjectsAndKeys:
-            [NSNumber numberWithInt:s.images.mappedSize], @"Images",
-            [NSNumber numberWithInt:s.cssStyleSheets.mappedSize] ,@"CSS",
-#if ENABLE(XSLT)
-            [NSNumber numberWithInt:s.xslStyleSheets.mappedSize], @"XSL",
-#else
-            [NSNumber numberWithInt:0], @"XSL",
-#endif
-            [NSNumber numberWithInt:s.scripts.mappedSize], @"JavaScript",
-            nil],
-#endif // ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
         nil];
 }
 
index 2d6b367..b022c71 100644 (file)
@@ -112,17 +112,6 @@ static inline WebDataSourcePrivate* toPrivate(void* privateAttribute)
     return reinterpret_cast<WebDataSourcePrivate*>(privateAttribute);
 }
 
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-static void BufferMemoryMapped(PassRefPtr<SharedBuffer> buffer, SharedBuffer::CompletionStatus mapStatus, SharedBuffer::MemoryMappedNotifyCallbackData data)
-{
-    NSObject<WebDataSourcePrivateDelegate> *delegate = [(WebDataSource *)data dataSourceDelegate];
-    if (mapStatus == SharedBuffer::Succeeded)
-        [delegate dataSourceMemoryMapped];
-    else
-        [delegate dataSourceMemoryMapFailed];
-}
-#endif
-
 @interface WebDataSource (WebFileInternal)
 @end
 
@@ -234,50 +223,15 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (void)_setAllowToBeMemoryMapped
 {
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-    RefPtr<ResourceBuffer> mainResourceBuffer = toPrivate(_private)->loader->mainResourceData();
-    if (!mainResourceBuffer)
-        return;
-
-    RefPtr<SharedBuffer> mainResourceData = mainResourceBuffer->sharedBuffer();
-    if (!mainResourceData)
-        return;
-
-    if (mainResourceData->memoryMappedNotificationCallback() != BufferMemoryMapped) {
-        ASSERT(!mainResourceData->memoryMappedNotificationCallback() && !mainResourceData->memoryMappedNotificationCallbackData());
-        mainResourceData->setMemoryMappedNotificationCallback(BufferMemoryMapped, self);
-    }
-
-    switch (mainResourceData->allowToBeMemoryMapped()) {
-    case SharedBuffer::SuccessAlreadyMapped:
-        [[self dataSourceDelegate] dataSourceMemoryMapped];
-        return;
-    case SharedBuffer::PreviouslyQueuedForMapping:
-    case SharedBuffer::QueuedForMapping:
-        return;
-    case SharedBuffer::FailureCacheFull:
-        [[self dataSourceDelegate] dataSourceMemoryMapFailed];
-        return;
-    }
-    ASSERT_NOT_REACHED();
-#endif
 }
 
 - (void)setDataSourceDelegate:(NSObject<WebDataSourcePrivateDelegate> *)delegate
 {
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-    ASSERT(!toPrivate(_private)->_dataSourceDelegate);
-    toPrivate(_private)->_dataSourceDelegate = delegate;
-#endif
 }
 
 - (NSObject<WebDataSourcePrivateDelegate> *)dataSourceDelegate
 {
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-    return toPrivate(_private)->_dataSourceDelegate;
-#else
     return nullptr;
-#endif
 }
 
 @end
@@ -480,24 +434,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     if (toPrivate(_private) && toPrivate(_private)->includedInWebKitStatistics)
         --WebDataSourceCount;
 
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-    // The code to remove memory mapped notification is only needed when we are viewing a PDF file.
-    // In such a case, WebPDFViewPlaceholder sets itself as the dataSourceDelegate. Guard the access
-    // to mainResourceData with this nil check so that we avoid assertions due to the resource being
-    // made purgeable.
-    if (_private && [self dataSourceDelegate]) {
-        RefPtr<ResourceBuffer> mainResourceBuffer = toPrivate(_private)->loader->mainResourceData();
-        if (mainResourceBuffer) {
-            RefPtr<SharedBuffer> mainResourceData = mainResourceBuffer->sharedBuffer();
-            if (mainResourceData && 
-                mainResourceData->memoryMappedNotificationCallbackData() == self &&
-                mainResourceData->memoryMappedNotificationCallback() == BufferMemoryMapped) {
-                mainResourceData->setMemoryMappedNotificationCallback(nullptr, nullptr);
-            }
-        }
-    }
-#endif
-    
 #if USE(QUICK_LOOK)
     // Added in -[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:].
     if (NSURL *url = [[self response] URL])
index dbb4dae..03d084e 100644 (file)
 #define WebKitNetworkInterfaceNamePreferenceKey @"WebKitNetworkInterfaceNamePreferenceKey"
 #endif
 
-#define WebKitDiskImageCacheEnabledPreferenceKey @"WebKitDiskImageCacheEnabled"
-#define WebKitDiskImageCacheMinimumImageSizePreferenceKey @"WebKitDiskImageCacheMinimumImageSize"
-#define WebKitDiskImageCacheMaximumCacheSizePreferenceKey @"WebKitDiskImageCacheMaximumCacheSize"
-#define WebKitDiskImageCacheSavedCacheDirectoryKey @"WebKitDiskImageCacheSavedCacheDirectory"
-
 #define WebKitEnableInheritURIQueryComponentPreferenceKey @"WebKitEnableInheritURIQueryComponent"
index 3ffdfc1..26dc53c 100644 (file)
@@ -565,11 +565,6 @@ public:
 #if ENABLE(IOS_TEXT_AUTOSIZING)
         [NSNumber numberWithFloat:WKGetMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
 #endif
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-        [NSNumber numberWithBool:YES], WebKitDiskImageCacheEnabledPreferenceKey,
-        [NSNumber numberWithUnsignedInt:(100 * 1024)], WebKitDiskImageCacheMinimumImageSizePreferenceKey,
-        [NSNumber numberWithUnsignedInt:(100 * 1024 * 1024)], WebKitDiskImageCacheMaximumCacheSizePreferenceKey,
-#endif
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
         [NSNumber numberWithBool:YES],  WebKitQTKitEnabledPreferenceKey,
@@ -1909,48 +1904,6 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:enabled forKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
 }
 
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-- (BOOL)diskImageCacheEnabled
-{
-    return [self _boolValueForKey:WebKitDiskImageCacheEnabledPreferenceKey];
-}
-
-- (void)setDiskImageCacheEnabled:(BOOL)enabled
-{
-    [self _setBoolValue:enabled forKey:WebKitDiskImageCacheEnabledPreferenceKey];
-}
-
-- (unsigned)diskImageCacheMinimumImageSize
-{
-    return [self _integerValueForKey:WebKitDiskImageCacheMinimumImageSizePreferenceKey];
-}
-
-- (void)setDiskImageCacheMinimumImageSize:(unsigned)minimumSize
-{
-    [self _setIntegerValue:minimumSize forKey:WebKitDiskImageCacheMinimumImageSizePreferenceKey];
-}
-
-- (unsigned)diskImageCacheMaximumCacheSize
-{
-    return [self _integerValueForKey:WebKitDiskImageCacheMaximumCacheSizePreferenceKey];
-}
-
-- (void)setDiskImageCacheMaximumCacheSize:(unsigned)maximumSize
-{
-    [self _setIntegerValue:maximumSize forKey:WebKitDiskImageCacheMaximumCacheSizePreferenceKey];
-}
-
-- (NSString *)_diskImageCacheSavedCacheDirectory
-{
-    return [[self _stringValueForKey:WebKitDiskImageCacheSavedCacheDirectoryKey] stringByStandardizingPath];
-}
-
-- (void)_setDiskImageCacheSavedCacheDirectory:(NSString *)path
-{
-    [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitDiskImageCacheSavedCacheDirectoryKey];
-}
-#endif // ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-
 - (BOOL)isFrameFlatteningEnabled
 {
     return [self _boolValueForKey:WebKitFrameFlatteningEnabledPreferenceKey];
index 326a9cd..e4da1ff 100644 (file)
@@ -271,18 +271,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 - (void)_setMinimumZoomFontSize:(float)size;
 - (float)_minimumZoomFontSize;
 
-- (BOOL)diskImageCacheEnabled;
-- (void)setDiskImageCacheEnabled:(BOOL)enabled;
-
-- (unsigned)diskImageCacheMinimumImageSize;
-- (void)setDiskImageCacheMinimumImageSize:(unsigned)minimumSize;
-
-- (unsigned)diskImageCacheMaximumCacheSize;
-- (void)setDiskImageCacheMaximumCacheSize:(unsigned)maximumSize;
-
-- (NSString *)_diskImageCacheSavedCacheDirectory;
-- (void)_setDiskImageCacheSavedCacheDirectory:(NSString *)path;
-
 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag;
 - (BOOL)mediaPlaybackAllowsAirPlay;
 #endif
index 2547bdb..c1f781c 100644 (file)
 #import <WebKitLegacy/WebDashboardRegion.h>
 #endif
 
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-#import "WebDiskImageCacheClientIOS.h"
-#import <WebCore/DiskImageCacheIOS.h>
-#endif
-
 #if ENABLE(REMOTE_INSPECTOR)
 #import <JavaScriptCore/RemoteInspector.h>
 #if PLATFORM(IOS)
 #import <WebCore/WebEventRegion.h>
 #endif
 
-#if ENABLE(DISK_IMAGE_CACHE)
-#import "WebDiskImageCacheClientIOS.h"
-#import <WebCore/DiskImageCacheIOS.h>
-#endif
-
 #if ENABLE(GAMEPAD)
 #import <WebCore/HIDGamepadProvider.h>
 #endif
@@ -903,9 +893,6 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 #endif
         WebKitInitializeStorageIfNecessary();
         WebKitInitializeApplicationCachePathIfNecessary();
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-        WebKitInitializeWebDiskImageCache();
-#endif
 #if ENABLE(GAMEPAD)
         WebKitInitializeGamepadProviderIfNecessary();
 #endif
@@ -1230,13 +1217,6 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 
     tileControllerMemoryHandler().trimUnparentedTilesToTarget(0);
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    {
-        WebKit::MemoryMeasure measurer("Memory warning: flushing images to disk.");
-        WebCore::memoryCache()->flushCachedImagesToDisk();
-    }
-#endif
-
     [WebStorageManager closeIdleLocalStorageDatabases];
 
     [WebView _releaseMemoryNow];
@@ -2409,13 +2389,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
     if (_private->zoomsTextOnly != zoomsTextOnly)
         [self _setZoomMultiplier:_private->zoomMultiplier isTextOnly:zoomsTextOnly];
 
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-    DiskImageCache& diskImageCache = WebCore::diskImageCache();
-    diskImageCache.setEnabled([preferences diskImageCacheEnabled]);
-    diskImageCache.setMinimumImageSize([preferences diskImageCacheMinimumImageSize]);
-    diskImageCache.setMaximumCacheSize([preferences diskImageCacheMaximumCacheSize]);
-#endif
-
 #if PLATFORM(IOS)
     [[self window] setTileBordersVisible:[preferences showDebugBorders]];
     [[self window] setTilePaintCountsVisible:[preferences showRepaintCounter]];