Remove an unused SPI method from WebKitLegacy
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Mar 2015 20:44:39 +0000 (20:44 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Mar 2015 20:44:39 +0000 (20:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143185

Reviewed by Sam Weinig.

Source/WebCore:

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
* loader/appcache/ApplicationCacheStorage.h:

Source/WebKit/mac:

* WebView/WebDataSource.mm:
(-[WebDataSource _transferApplicationCache:]): Deleted.
* WebView/WebDataSourcePrivate.h:

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

Source/WebCore/ChangeLog
Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
Source/WebCore/loader/appcache/ApplicationCacheStorage.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebDataSource.mm
Source/WebKit/mac/WebView/WebDataSourcePrivate.h

index 2d038f4..bc16668 100644 (file)
@@ -1,3 +1,14 @@
+2015-03-28  Anders Carlsson  <andersca@apple.com>
+
+        Remove an unused SPI method from WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=143185
+
+        Reviewed by Sam Weinig.
+
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
+        * loader/appcache/ApplicationCacheStorage.h:
+
 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
 
         nullptr cleanup in InlineFooBox classes
index 64192d1..9ee7fce 100644 (file)
@@ -1337,41 +1337,6 @@ bool ApplicationCacheStorage::writeDataToUniqueFileInDirectory(SharedBuffer* dat
     return true;
 }
 
-bool ApplicationCacheStorage::storeCopyOfCache(const String& cacheDirectory, ApplicationCacheHost* cacheHost)
-{
-    SQLiteTransactionInProgressAutoCounter transactionCounter;
-
-    ApplicationCache* cache = cacheHost->applicationCache();
-    if (!cache)
-        return true;
-
-    // Create a new cache.
-    RefPtr<ApplicationCache> cacheCopy = ApplicationCache::create();
-
-    cacheCopy->setOnlineWhitelist(cache->onlineWhitelist());
-    cacheCopy->setFallbackURLs(cache->fallbackURLs());
-
-    // Traverse the cache and add copies of all resources.
-    for (auto& resource : cache->resources().values()) {
-        RefPtr<ApplicationCacheResource> resourceCopy = ApplicationCacheResource::create(resource->url(), resource->response(), resource->type(), resource->data(), resource->path());
-        
-        cacheCopy->addResource(resourceCopy.release());
-    }
-
-    // Now create a new cache group.
-    auto groupCopy = std::make_unique<ApplicationCacheGroup>(cache->group()->manifestURL(), true);
-
-    groupCopy->setNewestCache(cacheCopy);
-    
-    ApplicationCacheStorage copyStorage;
-    copyStorage.setCacheDirectory(cacheDirectory);
-    
-    // Empty the cache in case something was there before.
-    copyStorage.empty();
-    
-    return copyStorage.storeNewestCache(groupCopy.get());
-}
-
 bool ApplicationCacheStorage::getManifestURLs(Vector<URL>* urls)
 {
     SQLiteTransactionInProgressAutoCounter transactionCounter;
index 3c75765..dd9ed95 100644 (file)
@@ -89,8 +89,6 @@ public:
     
     WEBCORE_EXPORT void empty();
     
-    static bool WEBCORE_EXPORT storeCopyOfCache(const String& cacheDirectory, ApplicationCacheHost*);
-
     bool getManifestURLs(Vector<URL>* urls);
     bool cacheGroupSize(const String& manifestURL, int64_t* size);
     bool deleteCacheGroup(const String& manifestURL);
index 04f5f82..91629b6 100644 (file)
@@ -1,3 +1,14 @@
+2015-03-28  Anders Carlsson  <andersca@apple.com>
+
+        Remove an unused SPI method from WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=143185
+
+        Reviewed by Sam Weinig.
+
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource _transferApplicationCache:]): Deleted.
+        * WebView/WebDataSourcePrivate.h:
+
 2015-03-26  Alex Christensen  <achristensen@webkit.org>
 
         Progress towards CMake on Mac.
index c246d28..866788f 100644 (file)
@@ -195,16 +195,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     return [[self response] MIMEType];
 }
 
-- (BOOL)_transferApplicationCache:(NSString*)destinationBundleIdentifier
-{
-    if (!toPrivate(_private)->loader)
-        return NO;
-        
-    NSString *cacheDir = [NSString _webkit_localCacheDirectoryWithBundleIdentifier:destinationBundleIdentifier];
-    
-    return ApplicationCacheStorage::storeCopyOfCache(cacheDir, toPrivate(_private)->loader->applicationCacheHost());
-}
-
 - (void)_setDeferMainResourceDataLoad:(BOOL)flag
 {
     if (!toPrivate(_private)->loader)
index a3a75de..195cd11 100644 (file)
@@ -43,8 +43,6 @@
 - (NSError *)_mainDocumentError;
 - (NSString *)_responseMIMEType;
 
-- (BOOL)_transferApplicationCache:(NSString*)destinationBundleIdentifier;
-
 - (void)_setDeferMainResourceDataLoad:(BOOL)flag;
 
 #if TARGET_OS_IPHONE