Title: [173265] trunk/Source
Revision
173265
Author
psola...@apple.com
Date
2014-09-04 10:36:21 -0700 (Thu, 04 Sep 2014)

Log Message

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.

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:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (173264 => 173265)


--- trunk/Source/WTF/ChangeLog	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WTF/ChangeLog	2014-09-04 17:36:21 UTC (rev 173265)
@@ -1,3 +1,15 @@
+2014-09-04  Pratik Solanki  <psola...@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  <m...@apple.com>
 
         Get rid of HIGH_DPI_CANVAS leftovers

Modified: trunk/Source/WTF/wtf/FeatureDefines.h (173264 => 173265)


--- trunk/Source/WTF/wtf/FeatureDefines.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WTF/wtf/FeatureDefines.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -70,10 +70,6 @@
 #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

Modified: trunk/Source/WebCore/ChangeLog (173264 => 173265)


--- trunk/Source/WebCore/ChangeLog	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/ChangeLog	2014-09-04 17:36:21 UTC (rev 173265)
@@ -1,3 +1,62 @@
+2014-09-04  Pratik Solanki  <psola...@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  <b...@cs.washington.edu>
 
         LegacyProfiler: ProfileNodes should be used more like structs

Modified: trunk/Source/WebCore/WebCore.exp.in (173264 => 173265)


--- trunk/Source/WebCore/WebCore.exp.in	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-09-04 17:36:21 UTC (rev 173265)
@@ -3021,16 +3021,6 @@
 __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

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (173264 => 173265)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-09-04 17:36:21 UTC (rev 173265)
@@ -3780,7 +3780,6 @@
 		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 */; };
@@ -3788,8 +3787,6 @@
 		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 */; };
@@ -10932,7 +10929,6 @@
 		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>"; };
@@ -10943,8 +10939,6 @@
 		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>"; };
@@ -21538,16 +21532,6 @@
 			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 = (
@@ -23687,8 +23671,6 @@
 				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 */,
@@ -27339,7 +27321,6 @@
 				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 */,

Modified: trunk/Source/WebCore/loader/ResourceBuffer.cpp (173264 => 173265)


--- trunk/Source/WebCore/loader/ResourceBuffer.cpp	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/ResourceBuffer.cpp	2014-09-04 17:36:21 UTC (rev 173265)
@@ -119,12 +119,4 @@
 }
 #endif
 
-#if ENABLE(DISK_IMAGE_CACHE)
-bool ResourceBuffer::isUsingDiskImageCache() const
-{
-    ASSERT(m_sharedBuffer);
-    return m_sharedBuffer && m_sharedBuffer->isAllowedToBeMemoryMapped();
-}
-#endif
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/loader/ResourceBuffer.h (173264 => 173265)


--- trunk/Source/WebCore/loader/ResourceBuffer.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/ResourceBuffer.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -74,9 +74,6 @@
 #if USE(CF)
     RetainPtr<CFDataRef> createCFData();
 #endif
-#if ENABLE(DISK_IMAGE_CACHE)
-    bool isUsingDiskImageCache() const;
-#endif
 
 protected:
     WEBCORE_EXPORT ResourceBuffer();

Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (173264 => 173265)


--- trunk/Source/WebCore/loader/cache/CachedImage.cpp	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp	2014-09-04 17:36:21 UTC (rev 173265)
@@ -56,10 +56,6 @@
 #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 @@
     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())

Modified: trunk/Source/WebCore/loader/cache/CachedImage.h (173264 => 173265)


--- trunk/Source/WebCore/loader/cache/CachedImage.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -85,11 +85,6 @@
     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:

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (173264 => 173265)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2014-09-04 17:36:21 UTC (rev 173265)
@@ -850,13 +850,6 @@
     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)
 {

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (173264 => 173265)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -247,12 +247,6 @@
     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)

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (173264 => 173265)


--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2014-09-04 17:36:21 UTC (rev 173265)
@@ -49,11 +49,6 @@
 #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 @@
     }
 }
 
-#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 @@
     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::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::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 @@
         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;
         }

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (173264 => 173265)


--- trunk/Source/WebCore/loader/cache/MemoryCache.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -85,19 +85,13 @@
         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 @@
     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&);

Modified: trunk/Source/WebCore/platform/Logging.h (173264 => 173265)


--- trunk/Source/WebCore/platform/Logging.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/platform/Logging.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -42,7 +42,6 @@
     M(Archives) \
     M(BackForward) \
     M(Compositing) \
-    M(DiskImageCache) \
     M(Editing) \
     M(Events) \
     M(FTP) \

Modified: trunk/Source/WebCore/platform/SharedBuffer.cpp (173264 => 173265)


--- trunk/Source/WebCore/platform/SharedBuffer.cpp	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/platform/SharedBuffer.cpp	2014-09-04 17:36:21 UTC (rev 173265)
@@ -31,10 +31,6 @@
 #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 @@
 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 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 @@
     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(const char* data, unsigned length)
 {
-#if ENABLE(DISK_IMAGE_CACHE)
-    ASSERT(!isMemoryMapped());
-#endif
     if (!length)
         return;
 
@@ -393,9 +291,6 @@
 
 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 @@
         return 0;
     }
 
-#if ENABLE(DISK_IMAGE_CACHE)
-    ASSERT(position < size());
-    if (isMemoryMapped()) {
-        const char* data = "" char*>(diskImageCache().dataForItem(m_diskImageCacheId));
-        someData = data + position;
-        return size() - position;
-    }
-#endif
-
     if (hasPlatformData()) {
         ASSERT_WITH_SECURITY_IMPLICATION(position < size());
         someData = data() + position;

Modified: trunk/Source/WebCore/platform/SharedBuffer.h (173264 => 173265)


--- trunk/Source/WebCore/platform/SharedBuffer.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/platform/SharedBuffer.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -118,30 +118,6 @@
     //      }
     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 @@
 #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;

Modified: trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp (173264 => 173265)


--- trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp	2014-09-04 17:36:21 UTC (rev 173265)
@@ -30,21 +30,11 @@
 
 #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 @@
 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);

Modified: trunk/Source/WebCore/platform/mac/SharedBufferMac.mm (173264 => 173265)


--- trunk/Source/WebCore/platform/mac/SharedBufferMac.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebCore/platform/mac/SharedBufferMac.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -37,15 +37,9 @@
 @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 @@
     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 @@
     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());
 }

Modified: trunk/Source/WebKit/ChangeLog (173264 => 173265)


--- trunk/Source/WebKit/ChangeLog	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/ChangeLog	2014-09-04 17:36:21 UTC (rev 173265)
@@ -1,3 +1,15 @@
+2014-09-04  Pratik Solanki  <psola...@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  <o...@webkit.org>
 
         Unreviwed, remove empty directories.

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (173264 => 173265)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2014-09-04 17:36:21 UTC (rev 173265)
@@ -358,8 +358,6 @@
 		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 */; };
@@ -744,8 +742,6 @@
 		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; };
@@ -1440,8 +1436,6 @@
 				A10C1D491820300E0036883A /* WebCaretChangeListener.h */,
 				A10C1D4A1820300E0036883A /* WebChromeClientIOS.h */,
 				A10C1D4B1820300E0036883A /* WebChromeClientIOS.mm */,
-				A10C1D4C1820300E0036883A /* WebDiskImageCacheClientIOS.h */,
-				A10C1D4D1820300E0036883A /* WebDiskImageCacheClientIOS.mm */,
 				A10C1D4E1820300E0036883A /* WebFixedPositionContent.h */,
 				A10C1D4F1820300E0036883A /* WebFixedPositionContent.mm */,
 				A10C1D501820300E0036883A /* WebFixedPositionContentInternal.h */,
@@ -1688,7 +1682,6 @@
 				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 */,
@@ -2192,7 +2185,6 @@
 				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 */,

Modified: trunk/Source/WebKit/ios/ChangeLog (173264 => 173265)


--- trunk/Source/WebKit/ios/ChangeLog	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/ios/ChangeLog	2014-09-04 17:36:21 UTC (rev 173265)
@@ -1,3 +1,20 @@
+2014-09-04  Pratik Solanki  <psola...@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_hor...@apple.com>
 
         Remove unnecessary (and unnecessarily iOS-specific) setStrokeAndFillColor

Deleted: trunk/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h (173264 => 173265)


--- trunk/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -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

Deleted: trunk/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm (173264 => 173265)


--- trunk/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -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)

Modified: trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm (173264 => 173265)


--- trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -249,32 +249,6 @@
 {
 }
 
-#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 @@
 - (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

Modified: trunk/Source/WebKit/mac/ChangeLog (173264 => 173265)


--- trunk/Source/WebKit/mac/ChangeLog	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-09-04 17:36:21 UTC (rev 173265)
@@ -1,3 +1,38 @@
+2014-09-04  Pratik Solanki  <psola...@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  <daba...@apple.com>
 
         [iOS] Make iOS build when ENABLE_TOUCH_EVENT and ENABLE_IOS_TOUCH_EVENTS disabled

Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (173264 => 173265)


--- trunk/Source/WebKit/mac/Misc/WebCache.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -108,18 +108,6 @@
 #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];
 }
 

Modified: trunk/Source/WebKit/mac/WebView/WebDataSource.mm (173264 => 173265)


--- trunk/Source/WebKit/mac/WebView/WebDataSource.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/WebView/WebDataSource.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -112,17 +112,6 @@
     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 @@
 
 - (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 @@
     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 = "" response] URL])

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (173264 => 173265)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -187,9 +187,4 @@
 #define WebKitNetworkInterfaceNamePreferenceKey @"WebKitNetworkInterfaceNamePreferenceKey"
 #endif
 
-#define WebKitDiskImageCacheEnabledPreferenceKey @"WebKitDiskImageCacheEnabled"
-#define WebKitDiskImageCacheMinimumImageSizePreferenceKey @"WebKitDiskImageCacheMinimumImageSize"
-#define WebKitDiskImageCacheMaximumCacheSizePreferenceKey @"WebKitDiskImageCacheMaximumCacheSize"
-#define WebKitDiskImageCacheSavedCacheDirectoryKey @"WebKitDiskImageCacheSavedCacheDirectory"
-
 #define WebKitEnableInheritURIQueryComponentPreferenceKey @"WebKitEnableInheritURIQueryComponent"

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (173264 => 173265)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -565,11 +565,6 @@
 #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 @@
     [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];

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (173264 => 173265)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2014-09-04 17:36:21 UTC (rev 173265)
@@ -271,18 +271,6 @@
 - (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

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (173264 => 173265)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2014-09-04 17:21:39 UTC (rev 173264)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2014-09-04 17:36:21 UTC (rev 173265)
@@ -254,11 +254,6 @@
 #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 <_javascript_Core/RemoteInspector.h>
 #if PLATFORM(IOS)
@@ -278,11 +273,6 @@
 #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 @@
 #endif
         WebKitInitializeStorageIfNecessary();
         WebKitInitializeApplicationCachePathIfNecessary();
-#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-        WebKitInitializeWebDiskImageCache();
-#endif
 #if ENABLE(GAMEPAD)
         WebKitInitializeGamepadProviderIfNecessary();
 #endif
@@ -1230,13 +1217,6 @@
 
     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 @@
     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]];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to