WebKit2: Need a way to manage the WebCore Cache
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2011 19:28:36 +0000 (19:28 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2011 19:28:36 +0000 (19:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=54501

Reviewed by Brady Eidson.

Source/WebCore:

Add a way to get a set of all of the origins that have entries in the
WebCore memory cache, and a method to remove all resources from the memory
cache from a given security origin.

No change in behavior.

* WebCore.exp.in: Add functions that need to be exported.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::removeResourcesWithOrigin):
(WebCore::MemoryCache::getOriginsWithCache):
* loader/cache/MemoryCache.h:

Source/WebKit2:

Implement a WebKit2 API to manage the WebCore memory cache. This API exposes three functions:

1) A method to get a list of all security origins that have entries in the WebCore memory cache.
2) A method to remove all entries in the WebCore memory cache from a SecurityOrigin.
3) A method to remove all entries from the WebCore memory cache.

* Platform/CoreIPC/MessageID.h: Add two new MessageClasses.
* Shared/API/c/WKBase.h:
* Shared/APIObject.h: Add a CacheManager type.
* Shared/WebSecurityOrigin.h: Typedef WKCacheManagerRef.
(WebKit::WebSecurityOrigin::createFromString): Creates a WebCore::SecurityOrigin using
    SecurityOrigin::createFromString.
(WebKit::WebSecurityOrigin::toString): Calls through to SecurityOrigin::toString.
* UIProcess/API/C/WKAPICast.h:

* UIProcess/API/C/WKCacheManager.cpp: Added.
(WKCacheManagerGetTypeID): Returns the WebResourceCacheManagerProxy type.
(WKCacheManagerGetCacheOrigins): Calls through to WebResourceCacheManagerProxy::getCacheOrigins.
(callGetCacheOriginsBlockBlockAndDispose):
(WKCacheManagerGetCacheOrigins_b):
(WKCacheManagerDeleteCacheForOrigin): Calls through to WebResourceCacheManagerProxy::deleteCacheForOrigin.
(WKCacheManagerDeleteAllCache): Calls through to WebResourceCacheManagerProxy::deleteAllCache.
* UIProcess/API/C/WKCacheManager.h: Added.

* UIProcess/API/C/WKContext.cpp:
(WKContextGetCacheManager): Calls to get the WebResourceCacheManagerProxy.
* UIProcess/API/C/WKContext.h:

* UIProcess/WebResourceCacheManagerProxy.cpp: Added.
(WebKit::WebResourceCacheManagerProxy::create): Calls through to the constructor.
(WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Initialize the m_webContext variable.
(WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy):
(WebKit::WebResourceCacheManagerProxy::invalidate): Invalidate the callback map.
(WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Call through to the web process to get the cache
    origins.
(WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Call the callback.
(WebKit::WebResourceCacheManagerProxy::deleteCacheForOrigin): Call through to the web process to delete cache
    for the given origin.
(WebKit::WebResourceCacheManagerProxy::deleteAllCache): Call through to the web process to delete all of the cache.
* UIProcess/WebResourceCacheManagerProxy.h: Added.
(WebKit::WebResourceCacheManagerProxy::clearContext):
(WebKit::WebResourceCacheManagerProxy::type):
* UIProcess/WebResourceCacheManagerProxy.messages.in: Added.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext): Initialize new member variable.
(WebKit::WebContext::~WebContext):  Invalidates new member variable.
(WebKit::WebContext::didReceiveMessage): Passes cache messages to the cache manager.
* UIProcess/WebContext.h:
(WebKit::WebContext::cacheManagerProxy):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage): Add a new message class.

* WebProcess/MemoryCache/WebResourceCacheManager.cpp: Added.
(WebKit::WebResourceCacheManager::shared):
(WebKit::WebResourceCacheManager::WebResourceCacheManager):
(WebKit::WebResourceCacheManager::~WebResourceCacheManager):
(WebKit::WebResourceCacheManager::didReceiveMessage): Calls through to didReceiveWebResourceCacheManagerMessage.
(WebKit::WebResourceCacheManager::getCacheOrigins): Gets a list of origins with cache entries from the memory
    cache, and puts them into a vector to send to the UI process.
(WebKit::WebResourceCacheManager::deleteCacheForOrigin): Calls through to memoryCache to delete all cache entries
    from a given origin.
(WebKit::WebResourceCacheManager::deleteAllCache):
* WebProcess/MemoryCache/WebResourceCacheManager.h: Added.
* WebProcess/MemoryCache/WebResourceCacheManager.messages.in: Added.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::clearResourceCaches): Tell the memory cache to evict its resources. This was done on WebKit1,
    but not WebKit2.
* WebProcess/WebProcess.h:

* WebKit2.xcodeproj/project.pbxproj: Added new files.
* win/WebKit2.vcproj: Ditto.
* win/WebKit2Common.vsprops: Added new include directory.
* win/WebKit2Generated.make: Added new header.

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

33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/DerivedSources.pro
Source/WebKit2/Platform/CoreIPC/MessageID.h
Source/WebKit2/Shared/API/c/WKBase.h
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/Shared/SecurityOriginData.cpp [new file with mode: 0644]
Source/WebKit2/Shared/SecurityOriginData.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKContext.h
Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.messages.in [new file with mode: 0644]
Source/WebKit2/WebKit2.pro
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h [new file with mode: 0644]
Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/win/WebKit2.vcproj
Source/WebKit2/win/WebKit2Common.vsprops
Source/WebKit2/win/WebKit2Generated.make

index a00e915..52061be 100644 (file)
@@ -1,3 +1,22 @@
+2011-02-16  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        WebKit2: Need a way to manage the WebCore Cache
+        https://bugs.webkit.org/show_bug.cgi?id=54501
+        
+        Add a way to get a set of all of the origins that have entries in the
+        WebCore memory cache, and a method to remove all resources from the memory
+        cache from a given security origin.
+
+        No change in behavior.
+
+        * WebCore.exp.in: Add functions that need to be exported.
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::removeResourcesWithOrigin):
+        (WebCore::MemoryCache::getOriginsWithCache):
+        * loader/cache/MemoryCache.h:
+
 2011-02-16  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Dan Bernstein.
index 9fa935a..7096342 100644 (file)
@@ -209,6 +209,9 @@ __ZN7WebCore11HistoryItemD1Ev
 __ZN7WebCore11MemoryCache11setDisabledEb
 __ZN7WebCore11MemoryCache13getStatisticsEv
 __ZN7WebCore11MemoryCache13setCapacitiesEjjj
+__ZN7WebCore11MemoryCache14evictResourcesEv
+__ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE
+__ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE
 __ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow
 __ZN7WebCore11memoryCacheEv
index c0927f8..cb11e15 100644 (file)
@@ -37,6 +37,7 @@
 #include "Logging.h"
 #include "ResourceHandle.h"
 #include "SecurityOrigin.h"
+#include "SecurityOriginHash.h"
 #include <stdio.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/text/CString.h>
@@ -474,6 +475,31 @@ void MemoryCache::resourceAccessed(CachedResource* resource)
     insertInLRUList(resource);
 }
 
+void MemoryCache::removeResourcesWithOrigin(SecurityOrigin* origin)
+{
+    Vector<CachedResource*> resourcesWithOrigin;
+
+    CachedResourceMap::iterator e = m_resources.end();
+    for (CachedResourceMap::iterator it = m_resources.begin(); it != e; ++it) {
+        CachedResource* resource = it->second;
+        RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::createFromString(resource->url());
+        if (!resourceOrigin)
+            continue;
+        if (resourceOrigin->equal(origin))
+            resourcesWithOrigin.append(resource);
+    }
+
+    for (size_t i = 0; i < resourcesWithOrigin.size(); ++i)
+        remove(resourcesWithOrigin[i]);
+}
+
+void MemoryCache::getOriginsWithCache(SecurityOriginSet& origins)
+{
+    CachedResourceMap::iterator e = m_resources.end();
+    for (CachedResourceMap::iterator it = m_resources.begin(); it != e; ++it)
+        origins.add(SecurityOrigin::create(KURL(KURL(), it->second->url())));
+}
+
 void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource* resource)
 {
     // If we've never been accessed, then we're brand new and not in any list.
@@ -622,6 +648,15 @@ void MemoryCache::setDisabled(bool disabled)
     }
 }
 
+void MemoryCache::evictResources()
+{
+    if (disabled())
+        return;
+
+    setDisabled(true);
+    setDisabled(false);
+}
+
 #ifndef NDEBUG
 void MemoryCache::dumpStats()
 {
index dd8b843..c9b91f9 100644 (file)
@@ -40,6 +40,8 @@ class CachedCSSStyleSheet;
 class CachedResource;
 class CachedResourceLoader;
 class KURL;
+class SecurityOrigin;
+struct SecurityOriginHash;
 
 // This cache holds subresources used by Web pages: images, scripts, stylesheets, etc.
 
@@ -125,6 +127,8 @@ public:
     // still live on if they are referenced by some Web page though.
     void setDisabled(bool);
     bool disabled() const { return m_disabled; }
+
+    void evictResources();
     
     void setPruneEnabled(bool enabled) { m_pruneEnabled = enabled; }
     void prune()
@@ -163,6 +167,10 @@ public:
     
     void resourceAccessed(CachedResource*);
 
+    typedef HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash> SecurityOriginSet;
+    void removeResourcesWithOrigin(SecurityOrigin*);
+    void getOriginsWithCache(SecurityOriginSet& origins);
+
 private:
     MemoryCache();
     ~MemoryCache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons.
index 5abb6a4..00dfc31 100644 (file)
@@ -1,3 +1,87 @@
+2011-02-16  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        WebKit2: Need a way to manage the WebCore Cache
+        https://bugs.webkit.org/show_bug.cgi?id=54501
+        
+        Implement a WebKit2 API to manage the WebCore memory cache. This API exposes three functions:
+        
+        1) A method to get a list of all security origins that have entries in the WebCore memory cache.
+        2) A method to remove all entries in the WebCore memory cache from a SecurityOrigin.
+        3) A method to remove all entries from the WebCore memory cache.
+
+        * Platform/CoreIPC/MessageID.h: Add two new MessageClasses.
+        * Shared/API/c/WKBase.h:
+        * Shared/APIObject.h: Add a CacheManager type.
+        * Shared/WebSecurityOrigin.h: Typedef WKCacheManagerRef.
+        (WebKit::WebSecurityOrigin::createFromString): Creates a WebCore::SecurityOrigin using 
+            SecurityOrigin::createFromString.
+        (WebKit::WebSecurityOrigin::toString): Calls through to SecurityOrigin::toString.
+        * UIProcess/API/C/WKAPICast.h:
+
+        * UIProcess/API/C/WKCacheManager.cpp: Added.
+        (WKCacheManagerGetTypeID): Returns the WebResourceCacheManagerProxy type.
+        (WKCacheManagerGetCacheOrigins): Calls through to WebResourceCacheManagerProxy::getCacheOrigins.
+        (callGetCacheOriginsBlockBlockAndDispose):
+        (WKCacheManagerGetCacheOrigins_b):
+        (WKCacheManagerDeleteCacheForOrigin): Calls through to WebResourceCacheManagerProxy::deleteCacheForOrigin.
+        (WKCacheManagerDeleteAllCache): Calls through to WebResourceCacheManagerProxy::deleteAllCache.
+        * UIProcess/API/C/WKCacheManager.h: Added.
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetCacheManager): Calls to get the WebResourceCacheManagerProxy.
+        * UIProcess/API/C/WKContext.h:
+
+        * UIProcess/WebResourceCacheManagerProxy.cpp: Added.
+        (WebKit::WebResourceCacheManagerProxy::create): Calls through to the constructor.
+        (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Initialize the m_webContext variable.
+        (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy):
+        (WebKit::WebResourceCacheManagerProxy::invalidate): Invalidate the callback map.
+        (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Call through to the web process to get the cache
+            origins.
+        (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Call the callback.
+        (WebKit::WebResourceCacheManagerProxy::deleteCacheForOrigin): Call through to the web process to delete cache
+            for the given origin. 
+        (WebKit::WebResourceCacheManagerProxy::deleteAllCache): Call through to the web process to delete all of the cache.
+        * UIProcess/WebResourceCacheManagerProxy.h: Added.
+        (WebKit::WebResourceCacheManagerProxy::clearContext):
+        (WebKit::WebResourceCacheManagerProxy::type):
+        * UIProcess/WebResourceCacheManagerProxy.messages.in: Added.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext): Initialize new member variable.
+        (WebKit::WebContext::~WebContext):  Invalidates new member variable.
+        (WebKit::WebContext::didReceiveMessage): Passes cache messages to the cache manager.
+        * UIProcess/WebContext.h:
+        (WebKit::WebContext::cacheManagerProxy):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didReceiveMessage): Add a new message class.
+
+        * WebProcess/MemoryCache/WebResourceCacheManager.cpp: Added.
+        (WebKit::WebResourceCacheManager::shared):
+        (WebKit::WebResourceCacheManager::WebResourceCacheManager):
+        (WebKit::WebResourceCacheManager::~WebResourceCacheManager):
+        (WebKit::WebResourceCacheManager::didReceiveMessage): Calls through to didReceiveWebResourceCacheManagerMessage.
+        (WebKit::WebResourceCacheManager::getCacheOrigins): Gets a list of origins with cache entries from the memory
+            cache, and puts them into a vector to send to the UI process.
+        (WebKit::WebResourceCacheManager::deleteCacheForOrigin): Calls through to memoryCache to delete all cache entries
+            from a given origin.
+        (WebKit::WebResourceCacheManager::deleteAllCache):
+        * WebProcess/MemoryCache/WebResourceCacheManager.h: Added.
+        * WebProcess/MemoryCache/WebResourceCacheManager.messages.in: Added.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveMessage):
+        (WebKit::WebProcess::clearResourceCaches): Tell the memory cache to evict its resources. This was done on WebKit1, 
+            but not WebKit2.
+        * WebProcess/WebProcess.h:
+        
+        * WebKit2.xcodeproj/project.pbxproj: Added new files.
+        * win/WebKit2.vcproj: Ditto.
+        * win/WebKit2Common.vsprops: Added new include directory.
+        * win/WebKit2Generated.make: Added new header.
+
 2011-02-16  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Dan Bernstein.
index 4350226..ca26cfd 100644 (file)
@@ -26,6 +26,7 @@ VPATH = \
     $(WebKit2)/WebProcess/Authentication \
     $(WebKit2)/WebProcess/Geolocation \
     $(WebKit2)/WebProcess/Plugins \
+    $(WebKit2)/WebProcess/ResourceCache \
     $(WebKit2)/WebProcess/WebCoreSupport \
     $(WebKit2)/WebProcess/WebPage \
     $(WebKit2)/WebProcess \
@@ -56,6 +57,8 @@ MESSAGE_RECEIVERS = \
     WebProcess \
     WebProcessConnection \
     WebProcessProxy \
+    WebResourceCacheManager \
+    WebResourceCacheManagerProxy \
 #
 
 SCRIPTS = \
index d7d4a7b..09387ea 100644 (file)
@@ -78,6 +78,7 @@ VPATH = \
     WebProcess/Authentication \
     WebProcess/Geolocation \
     WebProcess/Plugins \
+    WebProcess/ResourceCache \
     WebProcess/WebCoreSupport \
     WebProcess/WebPage \
     WebProcess \
@@ -103,7 +104,9 @@ MESSAGE_RECEIVERS = \
     WebPageProxy.messages.in \
     WebProcess.messages.in \
     WebProcessConnection.messages.in \
-    WebProcessProxy.messages.in
+    WebProcessProxy.messages.in \
+    WebResourceCacheManager.messages.in \
+    WebResourceCacheManagerProxy.messages.in
 
 SCRIPTS = \
     $$PWD/Scripts/generate-message-receiver.py \
index bd8180a..70ac9d9 100644 (file)
@@ -39,6 +39,7 @@ enum MessageClass {
     MessageClassDrawingArea,
     MessageClassDrawingAreaLegacy,
     MessageClassInjectedBundle,
+    MessageClassWebResourceCacheManager,
     MessageClassWebDatabaseManager,
     MessageClassWebGeolocationManagerProxy,
     MessageClassWebInspector,
@@ -49,6 +50,7 @@ enum MessageClass {
     MessageClassDownloadProxy,
     MessageClassDrawingAreaProxy,
     MessageClassDrawingAreaProxyLegacy,
+    MessageClassWebResourceCacheManagerProxy,
     MessageClassWebContext,
     MessageClassWebContextLegacy,
     MessageClassWebDatabaseManagerProxy,
index b91af54..a71db5d 100644 (file)
@@ -71,6 +71,7 @@ typedef const struct OpaqueWKAuthenticationChallenge* WKAuthenticationChallengeR
 typedef const struct OpaqueWKAuthenticationDecisionListener* WKAuthenticationDecisionListenerRef;
 typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
 typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
+typedef const struct OpaqueWKResourceCacheManager* WKResourceCacheManagerRef;
 typedef const struct OpaqueWKContext* WKContextRef;
 typedef const struct OpaqueWKCredential* WKCredentialRef;
 typedef const struct OpaqueWKDatabaseManager* WKDatabaseManagerRef;
index 4f316b4..9119a4e 100644 (file)
@@ -63,6 +63,7 @@ public:
         // UIProcess types
         TypeBackForwardList,
         TypeBackForwardListItem,
+        TypeCacheManager,
         TypeContext,
         TypeDatabaseManager,
         TypeDownload,
diff --git a/Source/WebKit2/Shared/SecurityOriginData.cpp b/Source/WebKit2/Shared/SecurityOriginData.cpp
new file mode 100644 (file)
index 0000000..c9eac44
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011 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 "SecurityOriginData.h"
+
+#include "WebCoreArgumentCoders.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void SecurityOriginData::encode(CoreIPC::ArgumentEncoder* encoder) const
+{
+    encoder->encode(CoreIPC::In(protocol, host, port));
+}
+
+bool SecurityOriginData::decode(CoreIPC::ArgumentDecoder* decoder, SecurityOriginData& securityOriginData)
+{
+    return decoder->decode(CoreIPC::Out(securityOriginData.protocol, securityOriginData.host, securityOriginData.port));
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/Shared/SecurityOriginData.h b/Source/WebKit2/Shared/SecurityOriginData.h
new file mode 100644 (file)
index 0000000..3c83568
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 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 SecurityOriginData_h
+#define SecurityOriginData_h
+
+#include <wtf/text/WTFString.h>
+
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+struct SecurityOriginData {
+    void encode(CoreIPC::ArgumentEncoder*) const;
+    static bool decode(CoreIPC::ArgumentDecoder*, SecurityOriginData&);
+
+    // FIXME <rdar://9018386>: We should be sending more state across the wire than just the protocol,
+    // host, and port.
+
+    String protocol;
+    String host;
+    int port;
+};
+
+} // namespace WebKit
+
+#endif // SecurityOriginData_h
index 978bc79..a595735 100644 (file)
@@ -47,6 +47,7 @@ class DownloadProxy;
 class GeolocationPermissionRequestProxy;
 class WebBackForwardList;
 class WebBackForwardListItem;
+class WebResourceCacheManagerProxy;
 class WebContext;
 class WebCredential;
 class WebDatabaseManagerProxy;
@@ -69,6 +70,7 @@ WK_ADD_API_MAPPING(WKAuthenticationChallengeRef, AuthenticationChallengeProxy)
 WK_ADD_API_MAPPING(WKAuthenticationDecisionListenerRef, AuthenticationDecisionListener)
 WK_ADD_API_MAPPING(WKBackForwardListItemRef, WebBackForwardListItem)
 WK_ADD_API_MAPPING(WKBackForwardListRef, WebBackForwardList)
+WK_ADD_API_MAPPING(WKResourceCacheManagerRef, WebResourceCacheManagerProxy)
 WK_ADD_API_MAPPING(WKContextRef, WebContext)
 WK_ADD_API_MAPPING(WKCredentialRef, WebCredential)
 WK_ADD_API_MAPPING(WKDatabaseManagerRef, WebDatabaseManagerProxy)
index 0de5e01..511344f 100644 (file)
@@ -158,6 +158,11 @@ void WKContextClearApplicationCache(WKContextRef contextRef)
     toImpl(contextRef)->clearApplicationCache();
 }
 
+WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef contextRef)
+{
+    return toAPI(toImpl(contextRef)->resourceCacheManagerProxy());
+}
+
 WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef contextRef)
 {
     return toAPI(toImpl(contextRef)->databaseManagerProxy());
index d2de56f..f12f692 100644 (file)
@@ -123,6 +123,7 @@ WK_EXPORT void WKContextClearApplicationCache(WKContextRef context);
 WK_EXPORT void WKContextStartMemorySampler(WKContextRef context, WKDoubleRef interval);
 WK_EXPORT void WKContextStopMemorySampler(WKContextRef context);
 
+WK_EXPORT WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef context);
 WK_EXPORT WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef context);
 WK_EXPORT WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef context);
 WK_EXPORT WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef context);
diff --git a/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp b/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp
new file mode 100644 (file)
index 0000000..483beeb
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 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 "WKResourceCacheManager.h"
+
+#include "WebResourceCacheManagerProxy.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKResourceCacheManagerGetTypeID()
+{
+    return toAPI(WebResourceCacheManagerProxy::APIType);
+}
+
+void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef cacheManagerRef, void* context, WKResourceCacheManagerGetCacheOriginsFunction callback)
+{
+    toImpl(cacheManagerRef)->getCacheOrigins(ArrayCallback::create(context, callback));
+}
+
+void WKResourceCacheManagerClearCacheForOrigin(WKResourceCacheManagerRef cacheManagerRef, WKSecurityOriginRef originRef)
+{
+    toImpl(cacheManagerRef)->clearCacheForOrigin(toImpl(originRef));
+}
+
+void WKResourceCacheManagerClearCacheForAllOrigins(WKResourceCacheManagerRef cacheManagerRef)
+{
+    toImpl(cacheManagerRef)->clearCacheForAllOrigins();    
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h b/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h
new file mode 100644 (file)
index 0000000..479169d
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 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 WKResourceCacheManager_h
+#define WKResourceCacheManager_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKResourceCacheManagerGetTypeID();
+
+typedef void (*WKResourceCacheManagerGetCacheOriginsFunction)(WKArrayRef, WKErrorRef, void*);
+WK_EXPORT void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef contextRef, void* context, WKResourceCacheManagerGetCacheOriginsFunction function);
+
+WK_EXPORT void WKResourceCacheManagerClearCacheForOrigin(WKResourceCacheManagerRef cacheManger, WKSecurityOriginRef origin);
+WK_EXPORT void WKResourceCacheManagerClearCacheForAllOrigins(WKResourceCacheManagerRef cacheManager);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKResourceCacheManager_h
index 773aadc..ffef45a 100644 (file)
@@ -33,6 +33,7 @@
 #include "SandboxExtension.h"
 #include "TextChecker.h"
 #include "WKContextPrivate.h"
+#include "WebResourceCacheManagerProxy.h"
 #include "WebContextMessageKinds.h"
 #include "WebContextUserMessageCoders.h"
 #include "WebCoreArgumentCoders.h"
@@ -96,6 +97,7 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
     , m_clearApplicationCacheForNewWebProcess(false)
     , m_memorySamplerEnabled(false)
     , m_memorySamplerInterval(1400.0)
+    , m_resourceCacheManagerProxy(WebResourceCacheManagerProxy::create(this))
     , m_databaseManagerProxy(WebDatabaseManagerProxy::create(this))
     , m_geolocationManagerProxy(WebGeolocationManagerProxy::create(this))
     , m_pluginSiteDataManager(WebPluginSiteDataManager::create(this))
@@ -116,6 +118,9 @@ WebContext::~WebContext()
 
     WebProcessManager::shared().contextWasDestroyed(this);
 
+    m_resourceCacheManagerProxy->invalidate();
+    m_resourceCacheManagerProxy->clearContext();
+
     m_geolocationManagerProxy->invalidate();
     m_geolocationManagerProxy->clearContext();
 
@@ -506,6 +511,11 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) {
+        m_resourceCacheManagerProxy->didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, arguments);
+        return;
+    }
+
     if (messageID.is<CoreIPC::MessageClassWebDatabaseManagerProxy>()) {
         m_databaseManagerProxy->didReceiveWebDatabaseManagerProxyMessage(connection, messageID, arguments);
         return;
index d1746d3..fe272b9 100644 (file)
@@ -45,6 +45,7 @@
 namespace WebKit {
 
 class DownloadProxy;
+class WebResourceCacheManagerProxy;
 class WebDatabaseManagerProxy;
 class WebGeolocationManagerProxy;
 class WebPageGroup;
@@ -127,6 +128,7 @@ public:
 
     static HashSet<String, CaseFoldingHash> pdfAndPostScriptMIMETypes();
 
+    WebResourceCacheManagerProxy* resourceCacheManagerProxy() const { return m_resourceCacheManagerProxy.get(); }
     WebDatabaseManagerProxy* databaseManagerProxy() const { return m_databaseManagerProxy.get(); }
     WebGeolocationManagerProxy* geolocationManagerProxy() const { return m_geolocationManagerProxy.get(); }
     WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); }
@@ -208,6 +210,7 @@ private:
     bool m_memorySamplerEnabled;
     double m_memorySamplerInterval;
 
+    RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy;
     RefPtr<WebDatabaseManagerProxy> m_databaseManagerProxy;
     RefPtr<WebGeolocationManagerProxy> m_geolocationManagerProxy;
     RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
index 67dc46b..a11d1c9 100644 (file)
@@ -230,6 +230,7 @@ void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC
     if (messageID.is<CoreIPC::MessageClassWebContext>()
         || messageID.is<CoreIPC::MessageClassWebContextLegacy>()
         || messageID.is<CoreIPC::MessageClassDownloadProxy>()
+        || messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()
         || messageID.is<CoreIPC::MessageClassWebDatabaseManagerProxy>()
         || messageID.is<CoreIPC::MessageClassWebGeolocationManagerProxy>()) {
         m_context->didReceiveMessage(connection, messageID, arguments);
diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
new file mode 100644 (file)
index 0000000..9343085
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2011 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 "WebResourceCacheManagerProxy.h"
+
+#include "ImmutableArray.h"
+#include "ImmutableDictionary.h"
+#include "SecurityOriginData.h"
+#include "WebContext.h"
+#include "WebResourceCacheManagerMessages.h"
+#include "WebSecurityOrigin.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<WebResourceCacheManagerProxy> WebResourceCacheManagerProxy::create(WebContext* webContext)
+{
+    return adoptRef(new WebResourceCacheManagerProxy(webContext));
+}
+
+WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebContext* webContext)
+    : m_webContext(webContext)
+{
+}
+
+WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()
+{
+}
+
+void WebResourceCacheManagerProxy::invalidate()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebResourceCacheManagerProxy::getCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
+{
+    RefPtr<ArrayCallback> callback = prpCallback;
+    if (!m_webContext->hasValidProcess()) {
+        callback->invalidate();
+        return;
+    }
+    uint64_t callbackID = callback->callbackID();
+    m_arrayCallbacks.set(callbackID, callback.release());
+    m_webContext->process()->send(Messages::WebResourceCacheManager::GetCacheOrigins(callbackID), 0);
+}
+
+void WebResourceCacheManagerProxy::didGetCacheOrigins(const Vector<SecurityOriginData>& origins, uint64_t callbackID)
+{
+    RefPtr<ArrayCallback> callback = m_arrayCallbacks.take(callbackID);
+    if (!callback) {
+        // FIXME: Log error or assert.
+        return;
+    }
+
+    size_t originIdentifiersCount = origins.size();
+    Vector<RefPtr<APIObject> > securityOrigins;
+    securityOrigins.reserveCapacity(originIdentifiersCount);
+
+    for (size_t i = 0; i < originIdentifiersCount; ++i) {
+        SecurityOriginData originData = origins[i];
+        RefPtr<APIObject> origin = WebSecurityOrigin::create(originData.protocol, originData.host, originData.port);
+        if (!origin)
+            continue;
+        securityOrigins.uncheckedAppend(origin);
+    }
+
+    callback->performCallbackWithReturnValue(ImmutableArray::adopt(securityOrigins).get());
+}
+
+void WebResourceCacheManagerProxy::clearCacheForOrigin(WebSecurityOrigin* origin)
+{
+    if (!m_webContext->hasValidProcess())
+        return;
+
+    SecurityOriginData securityOrigin;
+    securityOrigin.protocol = origin->protocol();
+    securityOrigin.host = origin->host();
+    securityOrigin.port = origin->port();
+    m_webContext->process()->send(Messages::WebResourceCacheManager::ClearCacheForOrigin(securityOrigin), 0);
+}
+
+void WebResourceCacheManagerProxy::clearCacheForAllOrigins()
+{
+    if (!m_webContext->hasValidProcess())
+        return;
+    m_webContext->process()->send(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(), 0);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
new file mode 100644 (file)
index 0000000..7383072
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2011 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 WebResourceCacheManagerProxy_h
+#define WebResourceCacheManagerProxy_h
+
+#include "APIObject.h"
+#include "Arguments.h"
+#include "GenericCallback.h"
+#include <wtf/HashMap.h>
+#include <wtf/PassRefPtr.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+class MessageID;
+}
+
+namespace WebKit {
+
+class SecurityOriginData;
+class WebContext;
+class WebSecurityOrigin;
+
+typedef GenericCallback<WKArrayRef> ArrayCallback;
+
+class WebResourceCacheManagerProxy : public APIObject {
+public:
+    static const Type APIType = TypeCacheManager;
+
+    static PassRefPtr<WebResourceCacheManagerProxy> create(WebContext*);
+    virtual ~WebResourceCacheManagerProxy();
+
+    void invalidate();
+    void clearContext() { m_webContext = 0; }
+
+    void getCacheOrigins(PassRefPtr<ArrayCallback>);
+    void clearCacheForOrigin(WebSecurityOrigin*);
+    void clearCacheForAllOrigins();
+
+    void didReceiveWebResourceCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+private:
+    explicit WebResourceCacheManagerProxy(WebContext*);
+
+    virtual Type type() const { return APIType; }
+
+    // Message handlers.
+    void didGetCacheOrigins(const Vector<SecurityOriginData>& originIdentifiers, uint64_t callbackID);
+
+    WebContext* m_webContext;
+    HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
+};
+
+} // namespace WebKit
+
+#endif // DatabaseManagerProxy_h
diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.messages.in b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.messages.in
new file mode 100644 (file)
index 0000000..c1e73a9
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) 2011 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.
+
+messages -> WebResourceCacheManagerProxy {
+    DidGetCacheOrigins(Vector<WebKit::SecurityOriginData> originIdentifiers, uint64_t callbackID)
+}
index ee5ae3f..6cc4bdf 100644 (file)
@@ -62,6 +62,7 @@ WEBKIT2_INCLUDEPATH = \
     WebProcess/InjectedBundle \
     WebProcess/InjectedBundle/DOM \
     WebProcess/InjectedBundle/API/c \
+    WebProcess/MemoryCache \
     WebProcess/Plugins \
     WebProcess/Plugins/Netscape \
     WebProcess/WebCoreSupport \
@@ -91,6 +92,8 @@ WEBKIT2_GENERATED_HEADERS = \
     $$WEBKIT2_GENERATED_SOURCES_DIR/PluginProcessMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/PluginProcessProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/PluginProxyMessages.h \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebResourceCacheManagerMessages.h \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebResourceCacheManagerProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebContextMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerProxyMessages.h \
@@ -111,6 +114,8 @@ WEBKIT2_GENERATED_SOURCES = \
     $$WEBKIT2_GENERATED_SOURCES_DIR/PluginProcessMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/PluginProcessProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/PluginProxyMessageReceiver.cpp \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebResourceCacheManagerMessageReceiver.cpp \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebResourceCacheManagerProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebContextMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerProxyMessageReceiver.cpp \
@@ -178,6 +183,7 @@ HEADERS += \
     Shared/PlatformPopupMenuData.h \
     Shared/PrintInfo.h \
     Shared/SameDocumentNavigationType.h \
+    Shared/SecurityOriginData.h \
     Shared/SessionState.h \
     Shared/StringPairVector.h \
     Shared/UserMessageCoders.h \
@@ -214,6 +220,7 @@ HEADERS += \
     UIProcess/API/C/WKAuthenticationDecisionListener.h \
     UIProcess/API/C/WKBackForwardList.h \
     UIProcess/API/C/WKBackForwardListItem.h \
+    UIProcess/API/C/WKResourceCacheManager.h \
     UIProcess/API/C/WKContext.h \
     UIProcess/API/C/WKContextPrivate.h \
     UIProcess/API/C/WKCredential.h \
@@ -271,6 +278,7 @@ HEADERS += \
     UIProcess/TextChecker.h \
     UIProcess/TiledDrawingAreaProxy.h \
     UIProcess/VisitedLinkProvider.h \
+    UIProcess/WebResourceCacheManagerProxy.h \
     UIProcess/WebContext.h \
     UIProcess/WebContextInjectedBundleClient.h \
     UIProcess/WebContextMenuProxy.h \
@@ -329,6 +337,7 @@ HEADERS += \
     WebProcess/InjectedBundle/InjectedBundlePageUIClient.h \
     WebProcess/InjectedBundle/InjectedBundleScriptWorld.h \
     WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \
+    WebProcess/MemoryCache/WebResourceCacheManager.h \
     WebProcess/Plugins/Netscape/JSNPMethod.h \
     WebProcess/Plugins/Netscape/JSNPObject.h \
     WebProcess/Plugins/Netscape/NPJSObject.h \
@@ -410,6 +419,7 @@ SOURCES += \
     Shared/OriginAndDatabases.cpp \
     Shared/PlatformPopupMenuData.cpp \
     Shared/PrintInfo.cpp \
+    Shared/SecurityOriginData.cpp \
     Shared/SessionState.cpp \
     Shared/VisitedLinkTable.cpp \
     Shared/WebBackForwardListItem.cpp \
@@ -445,6 +455,7 @@ SOURCES += \
     UIProcess/API/C/WKAuthenticationDecisionListener.cpp \
     UIProcess/API/C/WKBackForwardList.cpp \
     UIProcess/API/C/WKBackForwardListItem.cpp \
+    UIProcess/API/C/WKResourceCacheManager.cpp \
     UIProcess/API/C/WKContext.cpp \
     UIProcess/API/C/WKCredential.cpp \
     UIProcess/API/C/WKDatabaseManager.cpp \
@@ -493,6 +504,7 @@ SOURCES += \
     UIProcess/VisitedLinkProvider.cpp \
     UIProcess/WebBackForwardList.cpp \
     UIProcess/WebContext.cpp \
+    UIProcess/WebResourceCacheManagerProxy.cpp \
     UIProcess/WebContextInjectedBundleClient.cpp \
     UIProcess/WebContextMenuProxy.cpp \
     UIProcess/WebDatabaseManagerProxy.cpp \
@@ -566,6 +578,7 @@ SOURCES += \
     WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
     WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp \
     WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \
+    WebProcess/MemoryCache/WebResourceCacheManager.cpp \
     WebProcess/Plugins/Netscape/JSNPMethod.cpp \
     WebProcess/Plugins/Netscape/JSNPObject.cpp \
     WebProcess/Plugins/Netscape/NPJSObject.cpp \
index b84731e..4f32aa7 100644 (file)
                1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */; };
                29CD55AA128E294F00133C85 /* AccessibilityWebPageObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CD55A8128E294F00133C85 /* AccessibilityWebPageObject.h */; };
                29CD55AB128E294F00133C85 /* AccessibilityWebPageObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CD55A9128E294F00133C85 /* AccessibilityWebPageObject.mm */; };
+               33152975130D0CB200ED2483 /* SecurityOriginData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33152973130D0CB200ED2483 /* SecurityOriginData.cpp */; };
+               33152976130D0CB200ED2483 /* SecurityOriginData.h in Headers */ = {isa = PBXBuildFile; fileRef = 33152974130D0CB200ED2483 /* SecurityOriginData.h */; };
+               3336762F130C9998006C9DE2 /* WebResourceCacheManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3336762C130C9998006C9DE2 /* WebResourceCacheManager.cpp */; };
+               33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3336762D130C9998006C9DE2 /* WebResourceCacheManager.h */; };
+               33367635130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33367632130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp */; };
+               33367636130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367633130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h */; };
+               3336763A130C99DC006C9DE2 /* WKResourceCacheManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33367638130C99DC006C9DE2 /* WKResourceCacheManager.cpp */; };
+               3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367639130C99DC006C9DE2 /* WKResourceCacheManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
+               33367655130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33367651130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp */; };
+               33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367652130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h */; };
+               33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33367653130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp */; };
+               33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */; };
                37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
                51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */; };
                510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; };
                29CD55A8128E294F00133C85 /* AccessibilityWebPageObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityWebPageObject.h; sourceTree = "<group>"; };
                29CD55A9128E294F00133C85 /* AccessibilityWebPageObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityWebPageObject.mm; sourceTree = "<group>"; };
                32DBCF5E0370ADEE00C91783 /* WebKit2Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2Prefix.h; sourceTree = "<group>"; };
+               33152973130D0CB200ED2483 /* SecurityOriginData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecurityOriginData.cpp; sourceTree = "<group>"; };
+               33152974130D0CB200ED2483 /* SecurityOriginData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityOriginData.h; sourceTree = "<group>"; };
+               3336762C130C9998006C9DE2 /* WebResourceCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceCacheManager.cpp; path = ResourceCache/WebResourceCacheManager.cpp; sourceTree = "<group>"; };
+               3336762D130C9998006C9DE2 /* WebResourceCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceCacheManager.h; path = ResourceCache/WebResourceCacheManager.h; sourceTree = "<group>"; };
+               3336762E130C9998006C9DE2 /* WebResourceCacheManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebResourceCacheManager.messages.in; path = ResourceCache/WebResourceCacheManager.messages.in; sourceTree = "<group>"; };
+               33367632130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceCacheManagerProxy.cpp; sourceTree = "<group>"; };
+               33367633130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceCacheManagerProxy.h; sourceTree = "<group>"; };
+               33367634130C99B2006C9DE2 /* WebResourceCacheManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebResourceCacheManagerProxy.messages.in; sourceTree = "<group>"; };
+               33367638130C99DC006C9DE2 /* WKResourceCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKResourceCacheManager.cpp; sourceTree = "<group>"; };
+               33367639130C99DC006C9DE2 /* WKResourceCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKResourceCacheManager.h; sourceTree = "<group>"; };
+               33367651130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceCacheManagerMessageReceiver.cpp; path = /Users/brian_weinstein/OpenSource/WebKitBuild/Debug/DerivedSources/WebKit2/WebResourceCacheManagerMessageReceiver.cpp; sourceTree = "<absolute>"; };
+               33367652130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceCacheManagerMessages.h; path = /Users/brian_weinstein/OpenSource/WebKitBuild/Debug/DerivedSources/WebKit2/WebResourceCacheManagerMessages.h; sourceTree = "<absolute>"; };
+               33367653130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceCacheManagerProxyMessageReceiver.cpp; path = /Users/brian_weinstein/OpenSource/WebKitBuild/Debug/DerivedSources/WebKit2/WebResourceCacheManagerProxyMessageReceiver.cpp; sourceTree = "<absolute>"; };
+               33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceCacheManagerProxyMessages.h; path = /Users/brian_weinstein/OpenSource/WebKitBuild/Debug/DerivedSources/WebKit2/WebResourceCacheManagerProxyMessages.h; sourceTree = "<absolute>"; };
                37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; };
                51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; };
                510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItemData.cpp; sourceTree = "<group>"; };
                                E1CC1B8E12D7EADF00625838 /* PrintInfo.h */,
                                BC2D021612AC41CB00E732A3 /* SameDocumentNavigationType.h */,
                                1AAB4A8C1296F0A20023952F /* SandboxExtension.h */,
+                               33152973130D0CB200ED2483 /* SecurityOriginData.cpp */,
+                               33152974130D0CB200ED2483 /* SecurityOriginData.h */,
                                1AA41AB412C02EC4002BE67B /* SelectionState.h */,
                                518D2CC812D51DFB003BB93B /* SessionState.cpp */,
                                518D2CC912D51DFB003BB93B /* SessionState.h */,
                        tabWidth = 8;
                        usesTabs = 0;
                };
+               3336762B130C9978006C9DE2 /* ResourceCache */ = {
+                       isa = PBXGroup;
+                       children = (
+                               3336762C130C9998006C9DE2 /* WebResourceCacheManager.cpp */,
+                               3336762D130C9998006C9DE2 /* WebResourceCacheManager.h */,
+                               3336762E130C9998006C9DE2 /* WebResourceCacheManager.messages.in */,
+                       );
+                       name = ResourceCache;
+                       sourceTree = "<group>";
+               };
                512F588612A8834700629530 /* Authentication */ = {
                        isa = PBXGroup;
                        children = (
                                BC204EDF11C83E72008F3375 /* InjectedBundle */,
                                1A6FA01C11E1526300DB1371 /* mac */,
                                1A6FB7AA11E64B4900DB1371 /* Plugins */,
+                               3336762B130C9978006C9DE2 /* ResourceCache */,
                                BC032D5D10F437220058C15A /* WebCoreSupport */,
                                BC032D5E10F4372B0058C15A /* WebPage */,
                                1A6FA31511E3923600DB1371 /* WebKitMain.cpp */,
                                BC111B0D112F5E4F00337BAB /* WebProcessProxy.cpp */,
                                BC032DCF10F4389F0058C15A /* WebProcessProxy.h */,
                                BCEE7AB312817095009827DA /* WebProcessProxy.messages.in */,
+                               33367632130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp */,
+                               33367633130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h */,
+                               33367634130C99B2006C9DE2 /* WebResourceCacheManagerProxy.messages.in */,
                                BC858A1F12C0357B00EDEB2E /* WebResourceLoadClient.cpp */,
                                BC858A1E12C0357B00EDEB2E /* WebResourceLoadClient.h */,
                                1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */,
                                512F58F312A88A5400629530 /* WKProtectionSpace.cpp */,
                                512F58F412A88A5400629530 /* WKProtectionSpace.h */,
                                518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */,
+                               33367638130C99DC006C9DE2 /* WKResourceCacheManager.cpp */,
+                               33367639130C99DC006C9DE2 /* WKResourceCacheManager.h */,
                        );
                        path = C;
                        sourceTree = "<group>";
                                BC3066BD125A442100E71278 /* WebProcessMessages.h */,
                                BCEE7ACC12817988009827DA /* WebProcessProxyMessageReceiver.cpp */,
                                BCEE7ACD12817988009827DA /* WebProcessProxyMessages.h */,
+                               33367651130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp */,
+                               33367652130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h */,
+                               33367653130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp */,
+                               33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */,
                        );
                        name = "Derived Sources";
                        path = DerivedSources/WebKit2;
                                BCA56A6912F9C9AD00C566C7 /* WKGraphicsContextCG.h in Headers */,
                                1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */,
                                1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */,
+                               33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */,
+                               33367636130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h in Headers */,
+                               3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */,
+                               33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */,
+                               33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */,
+                               33152976130D0CB200ED2483 /* SecurityOriginData.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
                                1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */,
                                1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */,
+                               3336762F130C9998006C9DE2 /* WebResourceCacheManager.cpp in Sources */,
+                               33367635130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp in Sources */,
+                               3336763A130C99DC006C9DE2 /* WKResourceCacheManager.cpp in Sources */,
+                               33367655130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp in Sources */,
+                               33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */,
+                               33152975130D0CB200ED2483 /* SecurityOriginData.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp
new file mode 100644 (file)
index 0000000..c2b48df
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2011 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 "WebResourceCacheManager.h"
+
+#include "Connection.h"
+#include "MessageID.h"
+#include "SecurityOriginData.h"
+#include "WebCoreArgumentCoders.h"
+#include "WebResourceCacheManagerProxyMessages.h"
+#include "WebProcess.h"
+#include <WebCore/MemoryCache.h>
+#include <WebCore/SecurityOrigin.h>
+#include <WebCore/SecurityOriginHash.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebResourceCacheManager& WebResourceCacheManager::shared()
+{
+    static WebResourceCacheManager& shared = *new WebResourceCacheManager;
+    return shared;
+}
+
+WebResourceCacheManager::WebResourceCacheManager()
+{
+}
+
+WebResourceCacheManager::~WebResourceCacheManager()
+{
+}
+
+void WebResourceCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebResourceCacheManagerMessage(connection, messageID, arguments);
+}
+
+
+void WebResourceCacheManager::getCacheOrigins(uint64_t callbackID) const
+{
+    MemoryCache::SecurityOriginSet origins;
+    memoryCache()->getOriginsWithCache(origins);
+
+    Vector<SecurityOriginData> identifiers;
+    identifiers.reserveCapacity(origins.size());
+
+    MemoryCache::SecurityOriginSet::iterator end = origins.end();
+    for (MemoryCache::SecurityOriginSet::iterator it = origins.begin(); it != end; ++it) {
+        RefPtr<SecurityOrigin> origin = *it;
+        
+        SecurityOriginData originData;
+        originData.protocol = origin->protocol();
+        originData.host = origin->host();
+        originData.port = origin->port();
+
+        identifiers.uncheckedAppend(originData);
+    }
+
+    WebProcess::shared().connection()->send(Messages::WebResourceCacheManagerProxy::DidGetCacheOrigins(identifiers, callbackID), 0);
+}
+
+void WebResourceCacheManager::clearCacheForOrigin(SecurityOriginData originData) const
+{
+    RefPtr<SecurityOrigin> origin = SecurityOrigin::create(originData.protocol, originData.host, originData.port);
+    if (!origin)
+        return;
+
+    memoryCache()->removeResourcesWithOrigin(origin.get());
+}
+
+void WebResourceCacheManager::clearCacheForAllOrigins() const
+{
+    WebProcess::shared().clearResourceCaches();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h
new file mode 100644 (file)
index 0000000..1803a52
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011 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 WebResourceCacheManager_h
+#define WebResourceCacheManager_h
+
+#include "Arguments.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/text/WTFString.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+class MessageID;
+}
+
+namespace WebKit {
+
+class SecurityOriginData;
+
+class WebResourceCacheManager {
+    WTF_MAKE_NONCOPYABLE(WebResourceCacheManager);
+public:
+    static WebResourceCacheManager& shared();
+
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+private:
+    WebResourceCacheManager();
+    virtual ~WebResourceCacheManager();
+
+    // Implemented in generated WebResourceCacheManagerMessageReceiver.cpp
+    void didReceiveWebResourceCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+    void getCacheOrigins(uint64_t callbackID) const;
+    void clearCacheForOrigin(SecurityOriginData origin) const;
+    void clearCacheForAllOrigins() const;
+};
+
+} // namespace WebKit
+
+#endif // WebResourceCacheManager_h
diff --git a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.messages.in b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.messages.in
new file mode 100644 (file)
index 0000000..b6d5900
--- /dev/null
@@ -0,0 +1,27 @@
+# Copyright (C) 2011 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.
+
+messages -> WebResourceCacheManager {
+    void GetCacheOrigins(uint64_t callbackID)
+    void ClearCacheForOrigin(WebKit::SecurityOriginData originIdentifier)
+    void ClearCacheForAllOrigins()
+}
index 1dc12f6..cae2872 100644 (file)
@@ -33,6 +33,7 @@
 #include "InjectedBundleUserMessageCoders.h"
 #include "RunLoop.h"
 #include "SandboxExtension.h"
+#include "WebResourceCacheManager.h"
 #include "WebContextMessages.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebDatabaseManager.h"
@@ -50,6 +51,7 @@
 #include <WebCore/CrossOriginPreflightResultCache.h>
 #include <WebCore/Font.h>
 #include <WebCore/Language.h>
+#include <WebCore/MemoryCache.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/SchemeRegistry.h>
@@ -514,6 +516,11 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassWebResourceCacheManager>()) {
+        WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+
     if (messageID.is<CoreIPC::MessageClassWebDatabaseManager>()) {
         WebDatabaseManager::shared().didReceiveMessage(connection, messageID, arguments);
         return;
@@ -627,6 +634,8 @@ void WebProcess::clearResourceCaches()
     setCacheModel(CacheModelDocumentViewer);
     setCacheModel(cacheModel);
 
+    memoryCache()->evictResources();
+
     // Empty the cross-origin preflight cache.
     CrossOriginPreflightResultCache::shared().empty();
 }
index 91ca9d7..43c370f 100644 (file)
@@ -114,6 +114,8 @@ public:
     // Geolocation
     WebGeolocationManager& geolocationManager() { return m_geolocationManager; }
 
+    void clearResourceCaches();
+
 private:
     WebProcess();
 
@@ -139,7 +141,6 @@ private:
     static void calculateCacheSizes(CacheModel cacheModel, uint64_t memorySize, uint64_t diskFreeSize,
         unsigned& cacheTotalCapacity, unsigned& cacheMinDeadCapacity, unsigned& cacheMaxDeadCapacity, double& deadDecodedDataDeletionInterval,
         unsigned& pageCacheCapacity, unsigned long& urlCacheMemoryCapacity, unsigned long& urlCacheDiskCapacity);
-    void clearResourceCaches();
     void platformClearResourceCaches();
     void clearApplicationCache();
 
index 0b4ed29..1d81645 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="..\Shared\SecurityOriginData.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\Shared\SecurityOriginData.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\Shared\SelectionState.h"
                                >
                        </File>
                                        >
                                </File>
                        </Filter>
+            <Filter
+                Name="ResourceCache"
+                >
+                <File
+                                       RelativePath="..\WebProcess\ResourceCache\WebResourceCacheManager.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\WebProcess\ResourceCache\WebResourceCacheManager.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\WebProcess\ResourceCache\WebResourceCacheManager.messages.in"
+                                       >
+                               </File>
+            </Filter>
                        <Filter
                                Name="WebCoreSupport"
                                >
                                RelativePath="..\UIProcess\WebBackForwardList.h"
                                >
                        </File>
+            <File
+                               RelativePath="..\UIProcess\WebResourceCacheManagerProxy.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\UIProcess\WebResourceCacheManagerProxy.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\UIProcess\WebResourceCacheManagerProxy.messages.in"
+                               >
+                       </File>
                        <File
                                RelativePath="..\UIProcess\WebContext.cpp"
                                >
                                                RelativePath="..\UIProcess\API\C\WKBackForwardListItem.h"
                                                >
                                        </File>
+                    <File
+                                               RelativePath="..\UIProcess\API\C\WKResourceCacheManager.cpp"
+                                               >
+                                       </File>
+                                       <File
+                                               RelativePath="..\UIProcess\API\C\WKResourceCacheManager.h"
+                                               >
+                                       </File>
                                        <File
                                                RelativePath="..\UIProcess\API\C\WKContext.cpp"
                                                >
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\DrawingAreaProxyMessages.h"
                                >
                        </File>
+            <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebResourceCacheManagerMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebResourceCacheManagerMessages.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebResourceCacheManagerProxyMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebResourceCacheManagerProxyMessages.h"
+                               >
+                       </File>
                        <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebContextMessageReceiver.cpp"
                                >
index b29aa75..b069dd5 100755 (executable)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
+               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
                UsePrecompiledHeader="2"
                PrecompiledHeaderThrough="WebKit2Prefix.h"
index 7041209..5fe5b96 100644 (file)
@@ -41,6 +41,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\WKAuthenticationDecisionListener.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKBackForwardList.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKBackForwardListItem.h" "%ConfigurationBuildDir%\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\WKResourceCacheManager.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKContext.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKContextPrivate.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKCredential.h" "%ConfigurationBuildDir%\include\WebKit2"