Get rid of a couple of uses of ApplicationCacheStorage::singleton()
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2016 23:49:20 +0000 (23:49 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2016 23:49:20 +0000 (23:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=156818

Reviewed by Geoffrey Garen.

* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
* loader/appcache/ApplicationCacheGroup.h:
(WebCore::ApplicationCacheGroup::storage):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setApplicationCacheOriginQuota):

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

Source/WebCore/ChangeLog
Source/WebCore/loader/appcache/ApplicationCache.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.h
Source/WebCore/testing/Internals.cpp

index d0aacf4..2044be5 100644 (file)
@@ -1,3 +1,18 @@
+2016-04-20  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of a couple of uses of ApplicationCacheStorage::singleton()
+        https://bugs.webkit.org/show_bug.cgi?id=156818
+
+        Reviewed by Geoffrey Garen.
+
+        * loader/appcache/ApplicationCache.cpp:
+        (WebCore::ApplicationCache::addResource):
+        * loader/appcache/ApplicationCacheGroup.h:
+        (WebCore::ApplicationCacheGroup::storage):
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState):
+        (WebCore::Internals::setApplicationCacheOriginQuota):
+
 2016-04-20  Brady Eidson  <beidson@apple.com>
 
         Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
index db518f0..6f82e1d 100644 (file)
@@ -91,7 +91,7 @@ void ApplicationCache::addResource(PassRefPtr<ApplicationCacheResource> resource
         ASSERT(resource->type() & ApplicationCacheResource::Master);
         
         // Add the resource to the storage.
-        ApplicationCacheStorage::singleton().store(resource.get(), this);
+        m_group->storage().store(resource.get(), this);
     }
 
     m_estimatedSizeInStorage += resource->estimatedSizeInStorage();
index 4de8d5e..470e0bb 100644 (file)
@@ -63,7 +63,8 @@ public:
     
     static void selectCache(Frame*, const URL& manifestURL);
     static void selectCacheWithoutManifestURL(Frame*);
-    
+
+    ApplicationCacheStorage& storage() { return m_storage; }
     const URL& manifestURL() const { return m_manifestURL; }
     const SecurityOrigin* origin() const { return m_origin.get(); }
     UpdateStatus updateStatus() const { return m_updateStatus; }
index 72bbb93..f675cef 100644 (file)
@@ -398,7 +398,7 @@ void Internals::resetToConsistentState(Page& page)
     if (page.mainFrame().editor().isOverwriteModeEnabled())
         page.mainFrame().editor().toggleOverwriteModeEnabled();
     page.mainFrame().loader().clearTestingOverrides();
-    ApplicationCacheStorage::singleton().setDefaultOriginQuota(ApplicationCacheStorage::noQuota());
+    page.applicationCacheStorage().setDefaultOriginQuota(ApplicationCacheStorage::noQuota());
 #if ENABLE(VIDEO)
     PlatformMediaSessionManager::sharedManager().resetRestrictions();
     PlatformMediaSessionManager::sharedManager().setWillIgnoreSystemInterruptions(true);
@@ -2276,7 +2276,7 @@ void Internals::setApplicationCacheOriginQuota(unsigned long long quota)
     Document* document = contextDocument();
     if (!document)
         return;
-    ApplicationCacheStorage::singleton().storeUpdatedQuotaForOrigin(document->securityOrigin(), quota);
+    document->page()->applicationCacheStorage().storeUpdatedQuotaForOrigin(document->securityOrigin(), quota);
 }
 
 void Internals::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme)