WebKit2: Need API to manage the Media Cache
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Mar 2011 18:17:47 +0000 (18:17 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Mar 2011 18:17:47 +0000 (18:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=56878
<rdar://problem/9082503>

Reviewed by Darin Adler.

Project File Fun:
* GNUmakefile.am:
* WebKit2.pri:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
* win/WebKit2Common.vsprops:
* win/WebKit2Generated.make:

Derived Sources and API fun:
* DerivedSources.make:
* DerivedSources.pro:
* Platform/CoreIPC/MessageID.h:
* Shared/API/c/WKBase.h:
* Shared/APIObject.h:
* UIProcess/API/C/WKAPICast.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage): Ditto.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable.
(WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy.
(WebKit::WebContext::disconnectProcess): Ditto.
(WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages.
* UIProcess/WebContext.h:
(WebKit::WebContext::mediaCacheManagerProxy):

* UIProcess/API/C/WKContext.cpp:
(WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager.
* UIProcess/API/C/WKContext.h:

* UIProcess/API/C/WKMediaCacheManager.cpp: Added.
(WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type.
(WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy.
(WKMediaCacheManagerClearCacheForHostname): Ditto.
(WKMediaCacheManagerClearCacheForAllHostnames): Ditto.
* UIProcess/API/C/WKMediaCacheManager.h: Added.

* UIProcess/WebMediaCacheManagerProxy.cpp: Added.
(WebKit::WebMediaCacheManagerProxy::create):
(WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
(WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy):
(WebKit::WebMediaCacheManagerProxy::invalidate):
(WebKit::WebMediaCacheManagerProxy::didReceiveMessage):
(WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess.
(WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response,
    and call the callback.
(WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess.
(WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess.
* UIProcess/WebMediaCacheManagerProxy.h: Added.
(WebKit::WebMediaCacheManagerProxy::clearContext):
(WebKit::WebMediaCacheManagerProxy::type):
* UIProcess/WebMediaCacheManagerProxy.messages.in: Added.

* WebProcess/MediaCache: Added.
* WebProcess/MediaCache/WebMediaCacheManager.cpp: Added.
(WebKit::WebMediaCacheManager::shared):
(WebKit::WebMediaCacheManager::WebMediaCacheManager):
(WebKit::WebMediaCacheManager::didReceiveMessage):
(WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore.
(WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto.
(WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto.
* WebProcess/MediaCache/WebMediaCacheManager.h: Added.
* WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added.

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

28 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/DerivedSources.pro
Source/WebKit2/GNUmakefile.am
Source/WebKit2/Platform/CoreIPC/MessageID.h
Source/WebKit2/Shared/API/c/WKBase.h
Source/WebKit2/Shared/APIObject.h
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/WKMediaCacheManager.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.messages.in [new file with mode: 0644]
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/WebKit2.pri
Source/WebKit2/WebKit2.pro
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h [new file with mode: 0644]
Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/win/WebKit2.vcproj
Source/WebKit2/win/WebKit2Common.vsprops
Source/WebKit2/win/WebKit2Generated.make

index a75f6bb..5e73f0c 100644 (file)
@@ -1,3 +1,79 @@
+2011-03-22  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKit2: Need API to manage the Media Cache
+        https://bugs.webkit.org/show_bug.cgi?id=56878
+        <rdar://problem/9082503>
+
+        Project File Fun:
+        * GNUmakefile.am:
+        * WebKit2.pri:
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * win/WebKit2.vcproj:
+        * win/WebKit2Common.vsprops:
+        * win/WebKit2Generated.make:
+        
+        Derived Sources and API fun:
+        * DerivedSources.make:
+        * DerivedSources.pro:
+        * Platform/CoreIPC/MessageID.h:
+        * Shared/API/c/WKBase.h:
+        * Shared/APIObject.h:
+        * UIProcess/API/C/WKAPICast.h:
+        
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveMessage): Ditto.
+        
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable.
+        (WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy.
+        (WebKit::WebContext::disconnectProcess): Ditto.
+        (WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages.
+        * UIProcess/WebContext.h:
+        (WebKit::WebContext::mediaCacheManagerProxy):
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager.
+        * UIProcess/API/C/WKContext.h:
+
+        * UIProcess/API/C/WKMediaCacheManager.cpp: Added.
+        (WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type.
+        (WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy.
+        (WKMediaCacheManagerClearCacheForHostname): Ditto.
+        (WKMediaCacheManagerClearCacheForAllHostnames): Ditto.
+        * UIProcess/API/C/WKMediaCacheManager.h: Added.
+
+        * UIProcess/WebMediaCacheManagerProxy.cpp: Added.
+        (WebKit::WebMediaCacheManagerProxy::create):
+        (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
+        (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy):
+        (WebKit::WebMediaCacheManagerProxy::invalidate):
+        (WebKit::WebMediaCacheManagerProxy::didReceiveMessage):
+        (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess.
+        (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response,
+            and call the callback.
+        (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess.
+        (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess.
+        * UIProcess/WebMediaCacheManagerProxy.h: Added.
+        (WebKit::WebMediaCacheManagerProxy::clearContext):
+        (WebKit::WebMediaCacheManagerProxy::type):
+        * UIProcess/WebMediaCacheManagerProxy.messages.in: Added.
+
+        * WebProcess/MediaCache: Added.
+        * WebProcess/MediaCache/WebMediaCacheManager.cpp: Added.
+        (WebKit::WebMediaCacheManager::shared):
+        (WebKit::WebMediaCacheManager::WebMediaCacheManager):
+        (WebKit::WebMediaCacheManager::didReceiveMessage):
+        (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore.
+        (WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto.
+        (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto.
+        * WebProcess/MediaCache/WebMediaCacheManager.h: Added.
+        * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added.
+
 2011-03-22  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Sam Weinig.
index 0a6ef69..6f30dd4 100644 (file)
@@ -30,6 +30,7 @@ VPATH = \
     $(WebKit2)/WebProcess/Geolocation \
     $(WebKit2)/WebProcess/IconDatabase \
     $(WebKit2)/WebProcess/KeyValueStorage \
+    $(WebKit2)/WebProcess/MediaCache \
     $(WebKit2)/WebProcess/Plugins \
     $(WebKit2)/WebProcess/ResourceCache \
     $(WebKit2)/WebProcess/WebCoreSupport \
@@ -67,6 +68,8 @@ MESSAGE_RECEIVERS = \
     WebInspectorProxy \
     WebKeyValueStorageManager \
     WebKeyValueStorageManagerProxy \
+    WebMediaCacheManager \
+    WebMediaCacheManagerProxy \
     WebPage \
     WebPageProxy \
     WebProcess \
index 3dd44a0..e70d037 100644 (file)
@@ -82,6 +82,7 @@ VPATH = \
     WebProcess/Geolocation \
     WebProcess/IconDatabase \
     WebProcess/KeyValueStorage \
+    WebProcess/MemoryCache \
     WebProcess/Plugins \
     WebProcess/ResourceCache \
     WebProcess/WebCoreSupport \
@@ -113,6 +114,8 @@ MESSAGE_RECEIVERS = \
     WebInspectorProxy.messages.in \
     WebKeyValueStorageManager.messages.in \
     WebKeyValueStorageManagerProxy.messages.in \
+    WebMediaCacheManager.messages.in \
+    WebMediaCacheManagerProxy.messages.in \
     WebFullScreenManager.messages.in \
     WebFullScreenManagerProxy.messages.in \
     WebPage/WebInspector.messages.in \
index 2df040b..7510af5 100644 (file)
@@ -55,6 +55,7 @@ libWebKit2_la_HEADERS = \
        $(WebKit2)/UIProcess/API/C/WKFramePolicyListener.h \
        $(WebKit2)/UIProcess/API/C/WKInspector.h \
        $(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \
+       $(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \
        $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \
        $(WebKit2)/UIProcess/API/C/WKNavigationData.h \
        $(WebKit2)/UIProcess/API/C/WKOpenPanelParameters.h \
@@ -324,6 +325,8 @@ libWebKit2_la_SOURCES = \
        Source/WebKit2/UIProcess/API/C/WKInspector.h \
        Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp \
        Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h \
+       Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp \
+       Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h \
        Source/WebKit2/UIProcess/API/C/WKNativeEvent.h \
        Source/WebKit2/UIProcess/API/C/WKNavigationData.cpp \
        Source/WebKit2/UIProcess/API/C/WKNavigationData.h \
@@ -453,6 +456,8 @@ libWebKit2_la_SOURCES = \
        Source/WebKit2/UIProcess/WebInspectorProxy.h \
        Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \
        Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \
+       Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp \
+       Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h \
        Source/WebKit2/UIProcess/WebLoaderClient.cpp \
        Source/WebKit2/UIProcess/WebLoaderClient.h \
        Source/WebKit2/UIProcess/WebNavigationData.cpp \
@@ -570,6 +575,8 @@ libWebKit2_la_SOURCES = \
        Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \
        Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \
        Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \
+       Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp \
+       Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h \
        Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp \
        Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h \
        Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp \
@@ -713,6 +720,7 @@ libWebKit2_la_CPPFLAGS = \
        -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/gtk \
        -I$(srcdir)/Source/WebKit2/WebProcess/KeyValueStorage \
        -I$(srcdir)/Source/WebKit2/WebProcess/Launching \
+       -I$(srcdir)/Source/WebKit2/WebProcess/MediaCache \
        -I$(srcdir)/Source/WebKit2/WebProcess/ResourceCache \
        -I$(srcdir)/Source/WebKit2/WebProcess/Plugins \
        -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape \
@@ -887,6 +895,10 @@ webkit2_built_sources += \
        DerivedSources/WebKit2/WebKeyValueStorageManagerMessages.h \
        DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessageReceiver.cpp \
        DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessages.h \
+       DerivedSources/WebKit2/WebMediaCacheManagerMessageReceiver.cpp \
+       DerivedSources/WebKit2/WebMediaCacheManagerMessages.h \
+       DerivedSources/WebKit2/WebMediaCacheManagerProxyMessageReceiver.cpp \
+       DerivedSources/WebKit2/WebMediaCacheManagerProxyMessages.h \
        DerivedSources/WebKit2/WebPageProxyMessageReceiver.cpp \
        DerivedSources/WebKit2/WebPageProxyMessages.h \
        DerivedSources/WebKit2/WebPageMessageReceiver.cpp \
@@ -928,6 +940,7 @@ vpath %.messages.in = \
        $(WebKit2)/WebProcess/Geolocation \
        $(WebKit2)/WebProcess/IconDatabase \
        $(WebKit2)/WebProcess/KeyValueStorage \
+       $(WebKit2)/WebProcess/MediaCache \
        $(WebKit2)/WebProcess/Plugins \
        $(WebKit2)/WebProcess/ResourceCache \
        $(WebKit2)/WebProcess/WebCoreSupport \
index e712e5e..2afb168 100644 (file)
@@ -47,6 +47,7 @@ enum MessageClass {
     MessageClassWebIconDatabaseProxy,
     MessageClassWebInspector,
     MessageClassWebKeyValueStorageManager,
+    MessageClassWebMediaCacheManager,
     MessageClassWebPage,
     MessageClassWebProcess,
     MessageClassWebResourceCacheManager,
@@ -65,6 +66,7 @@ enum MessageClass {
     MessageClassWebIconDatabase,
     MessageClassWebInspectorProxy,
     MessageClassWebKeyValueStorageManagerProxy,
+    MessageClassWebMediaCacheManagerProxy,
     MessageClassWebPageProxy,
     MessageClassWebProcessProxy,
     MessageClassWebProcessProxyLegacy,
index 900cd51..c36ab4f 100644 (file)
@@ -86,6 +86,7 @@ typedef const struct OpaqueWKGeolocationPermissionRequest* WKGeolocationPermissi
 typedef const struct OpaqueWKGeolocationPosition* WKGeolocationPositionRef;
 typedef const struct OpaqueWKInspector* WKInspectorRef;
 typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef;
+typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef;
 typedef const struct OpaqueWKNavigationData* WKNavigationDataRef;
 typedef const struct OpaqueWKOpenPanelParameters* WKOpenPanelParametersRef;
 typedef const struct OpaqueWKOpenPanelResultListener* WKOpenPanelResultListenerRef;
index 2c5891d..7f50b51 100644 (file)
@@ -79,6 +79,7 @@ public:
         TypeIconDatabase,
         TypeInspector,
         TypeKeyValueStorageManager,
+        TypeMediaCacheManager,
         TypeNavigationData,
         TypeOpenPanelParameters,
         TypeOpenPanelResultListener,
index 68b2b7d..b627a2e 100644 (file)
@@ -61,6 +61,7 @@ class WebGeolocationManagerProxy;
 class WebGeolocationPosition;
 class WebInspectorProxy;
 class WebKeyValueStorageManagerProxy;
+class WebMediaCacheManagerProxy;
 class WebNavigationData;
 class WebOpenPanelParameters;
 class WebOpenPanelResultListenerProxy;
@@ -88,6 +89,7 @@ WK_ADD_API_MAPPING(WKGeolocationManagerRef, WebGeolocationManagerProxy)
 WK_ADD_API_MAPPING(WKGeolocationPermissionRequestRef, GeolocationPermissionRequestProxy)
 WK_ADD_API_MAPPING(WKGeolocationPositionRef, WebGeolocationPosition)
 WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy)
+WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy)
 WK_ADD_API_MAPPING(WKNavigationDataRef, WebNavigationData)
 WK_ADD_API_MAPPING(WKOpenPanelParametersRef, WebOpenPanelParameters)
 WK_ADD_API_MAPPING(WKOpenPanelResultListenerRef, WebOpenPanelResultListenerProxy)
index b1d9313..9f65a93 100644 (file)
@@ -183,6 +183,11 @@ WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef cont
     return toAPI(toImpl(contextRef)->keyValueStorageManagerProxy());
 }
 
+WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef contextRef)
+{
+    return toAPI(toImpl(contextRef)->mediaCacheManagerProxy());
+}
+
 WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contextRef)
 {
     return toAPI(toImpl(contextRef)->pluginSiteDataManager());
index 0ac0ea1..d616258 100644 (file)
@@ -134,6 +134,7 @@ WK_EXPORT WKCookieManagerRef WKContextGetCookieManager(WKContextRef context);
 WK_EXPORT WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef context);
 WK_EXPORT WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef context);
 WK_EXPORT WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef context);
+WK_EXPORT WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef context);
 WK_EXPORT WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef context);
 WK_EXPORT WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef context);
 
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp b/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp
new file mode 100644 (file)
index 0000000..6e2ecce
--- /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 "WKMediaCacheManager.h"
+
+#include "WKAPICast.h"
+#include "WebMediaCacheManagerProxy.h"
+
+using namespace WebKit;
+
+WKTypeID WKMediaCacheManagerGetTypeID()
+{
+    return toAPI(WebMediaCacheManagerProxy::APIType);
+}
+
+void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManagerRef, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction callback)
+{
+    toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(ArrayCallback::create(context, callback));
+}
+
+void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManagerRef, WKStringRef hostname)
+{
+    toImpl(mediaCacheManagerRef)->clearCacheForHostname(toWTFString(hostname));
+}
+
+void WKMediaCacheManagerClearCacheForAllHostnames(WKMediaCacheManagerRef mediaCacheManagerRef)
+{
+    toImpl(mediaCacheManagerRef)->clearCacheForAllHostnames();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h b/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h
new file mode 100644 (file)
index 0000000..eee1b92
--- /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 WKMediaCacheManager_h
+#define WKMediaCacheManager_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKMediaCacheManagerGetTypeID();
+
+typedef void (*WKMediaCacheManagerGetHostnamesWithMediaCacheFunction)(WKArrayRef, WKErrorRef, void*);
+WK_EXPORT void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManager, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction function);
+
+WK_EXPORT void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManager, WKStringRef hostname);
+WK_EXPORT void WKMediaCacheManagerClearCacheForAllHostnames(WKMediaCacheManagerRef mediaCacheManager);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKMediaCacheManager_h
index 9156599..6d9093f 100644 (file)
@@ -43,6 +43,7 @@
 #include "WebGeolocationManagerProxy.h"
 #include "WebIconDatabase.h"
 #include "WebKeyValueStorageManagerProxy.h"
+#include "WebMediaCacheManagerProxy.h"
 #include "WebPluginSiteDataManager.h"
 #include "WebPageGroup.h"
 #include "WebMemorySampler.h"
@@ -120,6 +121,7 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
     , m_geolocationManagerProxy(WebGeolocationManagerProxy::create(this))
     , m_iconDatabase(WebIconDatabase::create(this))
     , m_keyValueStorageManagerProxy(WebKeyValueStorageManagerProxy::create(this))
+    , m_mediaCacheManagerProxy(WebMediaCacheManagerProxy::create(this))
     , m_pluginSiteDataManager(WebPluginSiteDataManager::create(this))
     , m_resourceCacheManagerProxy(WebResourceCacheManagerProxy::create(this))
 #if PLATFORM(WIN)
@@ -166,6 +168,9 @@ WebContext::~WebContext()
     m_keyValueStorageManagerProxy->invalidate();
     m_keyValueStorageManagerProxy->clearContext();
 
+    m_mediaCacheManagerProxy->invalidate();
+    m_mediaCacheManagerProxy->clearContext();
+
     m_pluginSiteDataManager->invalidate();
     m_pluginSiteDataManager->clearContext();
 
@@ -321,6 +326,7 @@ void WebContext::disconnectProcess(WebProcessProxy* process)
     m_databaseManagerProxy->invalidate();
     m_geolocationManagerProxy->invalidate();
     m_keyValueStorageManagerProxy->invalidate();
+    m_mediaCacheManagerProxy->invalidate();
     m_resourceCacheManagerProxy->invalidate();
 
     // When out of process plug-ins are enabled, we don't want to invalidate the plug-in site data
@@ -616,6 +622,11 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>()) {
+        m_mediaCacheManagerProxy->didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+
     if (messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) {
         m_resourceCacheManagerProxy->didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, arguments);
         return;
index 566f98d..2a1f8f2 100644 (file)
@@ -51,6 +51,7 @@ class WebDatabaseManagerProxy;
 class WebGeolocationManagerProxy;
 class WebIconDatabase;
 class WebKeyValueStorageManagerProxy;
+class WebMediaCacheManagerProxy;
 class WebPageGroup;
 class WebPageProxy;
 class WebResourceCacheManagerProxy;
@@ -145,6 +146,7 @@ public:
     WebDatabaseManagerProxy* databaseManagerProxy() const { return m_databaseManagerProxy.get(); }
     WebGeolocationManagerProxy* geolocationManagerProxy() const { return m_geolocationManagerProxy.get(); }
     WebKeyValueStorageManagerProxy* keyValueStorageManagerProxy() const { return m_keyValueStorageManagerProxy.get(); }
+    WebMediaCacheManagerProxy* mediaCacheManagerProxy() const { return m_mediaCacheManagerProxy.get(); }
     WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); }
     WebResourceCacheManagerProxy* resourceCacheManagerProxy() const { return m_resourceCacheManagerProxy.get(); }
 
@@ -242,6 +244,7 @@ private:
     RefPtr<WebGeolocationManagerProxy> m_geolocationManagerProxy;
     RefPtr<WebIconDatabase> m_iconDatabase;
     RefPtr<WebKeyValueStorageManagerProxy> m_keyValueStorageManagerProxy;
+    RefPtr<WebMediaCacheManagerProxy> m_mediaCacheManagerProxy;
     RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
     RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy;
 
diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
new file mode 100644 (file)
index 0000000..f0eb619
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * 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 "WebMediaCacheManagerProxy.h"
+
+#include "WebContext.h"
+#include "WebMediaCacheManagerMessages.h"
+#include "WebSecurityOrigin.h"
+
+namespace WebKit {
+
+PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebContext* context)
+{
+    return adoptRef(new WebMediaCacheManagerProxy(context));
+}
+
+WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context)
+    : m_webContext(context)
+{
+}
+
+WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()
+{
+}
+
+void WebMediaCacheManagerProxy::invalidate()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebMediaCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebMediaCacheManagerProxyMessage(connection, messageID, arguments);
+}
+
+void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(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::WebMediaCacheManager::GetHostnamesWithMediaCache(callbackID), 0);
+}
+    
+void WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache(const Vector<String>& hostnameList, uint64_t callbackID)
+{
+    RefPtr<ArrayCallback> callback = m_arrayCallbacks.take(callbackID);
+    if (!callback) {
+        // FIXME: Log error or assert.
+        return;
+    }
+
+    size_t hostnameCount = hostnameList.size();
+    Vector<RefPtr<APIObject> > hostnames(hostnameCount);
+
+    for (size_t i = 0; i < hostnameCount; ++i)
+        hostnames[i] = WebString::create(hostnameList[i]);
+
+    callback->performCallbackWithReturnValue(ImmutableArray::adopt(hostnames).get());
+}
+
+void WebMediaCacheManagerProxy::clearCacheForHostname(const String& hostname)
+{
+    if (!m_webContext->hasValidProcess())
+        return;
+
+    m_webContext->process()->send(Messages::WebMediaCacheManager::ClearCacheForHostname(hostname), 0);
+}
+
+void WebMediaCacheManagerProxy::clearCacheForAllHostnames()
+{
+    if (!m_webContext->hasValidProcess())
+        return;
+
+    m_webContext->process()->send(Messages::WebMediaCacheManager::ClearCacheForAllHostnames(), 0);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
new file mode 100644 (file)
index 0000000..0240d4f
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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 WebMediaCacheManagerProxy_h
+#define WebMediaCacheManagerProxy_h
+
+#include "APIObject.h"
+#include "GenericCallback.h"
+#include "ImmutableArray.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class Connection;
+    class MessageID;
+}
+
+namespace WebKit {
+
+class WebContext;
+
+typedef GenericCallback<WKArrayRef> ArrayCallback;
+
+class WebMediaCacheManagerProxy : public APIObject {
+public:
+    static const Type APIType = TypeMediaCacheManager;
+
+    static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*);
+    virtual ~WebMediaCacheManagerProxy();
+
+    void invalidate();
+    void clearContext() { m_webContext = 0; }
+    
+    void getHostnamesWithMediaCache(PassRefPtr<ArrayCallback>);
+    void clearCacheForHostname(const String&);
+    void clearCacheForAllHostnames();
+
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+private:
+    WebMediaCacheManagerProxy(WebContext*);
+
+    virtual Type type() const { return APIType; }
+
+    void didGetHostnamesWithMediaCache(const Vector<String>&, uint64_t callbackID);
+    
+    void didReceiveWebMediaCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+    WebContext* m_webContext;
+    HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
+};
+
+} // namespace WebKit
+
+#endif // WebMediaCacheManagerProxy_h
diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.messages.in b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.messages.in
new file mode 100644 (file)
index 0000000..7929064
--- /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 -> WebMediaCacheManagerProxy {
+    DidGetHostnamesWithMediaCache(Vector<WTF::String> hostnames, uint64_t callbackID);
+}
index 5b6944e..8a48724 100644 (file)
@@ -254,6 +254,7 @@ void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC
         || messageID.is<CoreIPC::MessageClassWebGeolocationManagerProxy>()
         || messageID.is<CoreIPC::MessageClassWebIconDatabase>()
         || messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>()
+        || messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>()
         || messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) {
         m_context->didReceiveMessage(connection, messageID, arguments);
         return;
index 14de83a..d278442 100644 (file)
@@ -50,6 +50,7 @@ WEBKIT2_INCLUDEPATH = \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/DOM \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c \
     $$SOURCE_DIR/WebKit2/WebProcess/KeyValueStorage \
+    $$SOURCE_DIR/WebKit2/WebProcess/MediaCache \
     $$SOURCE_DIR/WebKit2/WebProcess/Plugins \
     $$SOURCE_DIR/WebKit2/WebProcess/Plugins/Netscape \
     $$SOURCE_DIR/WebKit2/WebProcess/ResourceCache \
index 23f3e9e..c3d488e 100644 (file)
@@ -43,6 +43,8 @@ WEBKIT2_GENERATED_HEADERS = \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerProxyMessages.h \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerMessages.h \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebProcessConnectionMessages.h \
@@ -76,6 +78,8 @@ WEBKIT2_GENERATED_SOURCES = \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerProxyMessageReceiver.cpp \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerMessageReceiver.cpp \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebProcessConnectionMessageReceiver.cpp \
@@ -206,6 +210,7 @@ HEADERS += \
     UIProcess/WebInspectorProxy.h \
     UIProcess/WebKeyValueStorageManagerProxy.h \
     UIProcess/WebLoaderClient.h \
+    UIProcess/WebMediaCacheManagerProxy.h \
     UIProcess/WebNavigationData.h \
     UIProcess/WebOpenPanelResultListenerProxy.h \
     UIProcess/WebPageContextMenuClient.h \
@@ -241,6 +246,7 @@ HEADERS += \
     WebProcess/InjectedBundle/InjectedBundleScriptWorld.h \
     WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \
     WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \
+    WebProcess/MediaCache/WebMediaCacheManager.h \
     WebProcess/ResourceCache/WebResourceCacheManager.h \
     WebProcess/Plugins/Netscape/JSNPMethod.h \
     WebProcess/Plugins/Netscape/JSNPObject.h \
@@ -400,6 +406,7 @@ SOURCES += \
     UIProcess/WebInspectorProxy.cpp \
     UIProcess/WebKeyValueStorageManagerProxy.cpp \
     UIProcess/WebLoaderClient.cpp \
+    UIProcess/WebMediaCacheManagerProxy.cpp \
     UIProcess/WebNavigationData.cpp \
     UIProcess/WebOpenPanelResultListenerProxy.cpp \
     UIProcess/WebPageContextMenuClient.cpp \
@@ -449,6 +456,7 @@ SOURCES += \
     WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp \
     WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \
     WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \
+    WebProcess/MediaCache/WebMediaCacheManager.cpp \
     WebProcess/ResourceCache/WebResourceCacheManager.cpp \
     WebProcess/Plugins/Netscape/JSNPMethod.cpp \
     WebProcess/Plugins/Netscape/JSNPObject.cpp \
index 338775a..4f0b9f0 100644 (file)
                33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */; };
                33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */; };
                33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */; };
+               33D3A3B51339600B00709BE4 /* WKMediaCacheManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3B31339600B00709BE4 /* WKMediaCacheManager.cpp */; };
+               33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3B41339600B00709BE4 /* WKMediaCacheManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               33D3A3BA1339606200709BE4 /* WebMediaCacheManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3B71339606200709BE4 /* WebMediaCacheManagerProxy.cpp */; };
+               33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3B81339606200709BE4 /* WebMediaCacheManagerProxy.h */; };
+               33D3A3C1133960B000709BE4 /* WebMediaCacheManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3BE133960B000709BE4 /* WebMediaCacheManager.cpp */; };
+               33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3BF133960B000709BE4 /* WebMediaCacheManager.h */; };
+               33D3A3C81339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3C41339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp */; };
+               33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */; };
+               33D3A3CA1339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */; };
+               33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */; };
                33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */; };
                37C4E9F6131C6E7E0029BD5A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = B396EA5512E0ED2D00F4FEB7 /* config.h */; };
                37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
                33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceCacheManagerProxyMessages.h; sourceTree = "<group>"; };
                33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCookieManagerProxyClient.cpp; sourceTree = "<group>"; };
                33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCookieManagerProxyClient.h; sourceTree = "<group>"; };
+               33D3A3B31339600B00709BE4 /* WKMediaCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKMediaCacheManager.cpp; sourceTree = "<group>"; };
+               33D3A3B41339600B00709BE4 /* WKMediaCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMediaCacheManager.h; sourceTree = "<group>"; };
+               33D3A3B71339606200709BE4 /* WebMediaCacheManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaCacheManagerProxy.cpp; sourceTree = "<group>"; };
+               33D3A3B81339606200709BE4 /* WebMediaCacheManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerProxy.h; sourceTree = "<group>"; };
+               33D3A3B91339606200709BE4 /* WebMediaCacheManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebMediaCacheManagerProxy.messages.in; sourceTree = "<group>"; };
+               33D3A3BE133960B000709BE4 /* WebMediaCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebMediaCacheManager.cpp; path = MediaCache/WebMediaCacheManager.cpp; sourceTree = "<group>"; };
+               33D3A3BF133960B000709BE4 /* WebMediaCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebMediaCacheManager.h; path = MediaCache/WebMediaCacheManager.h; sourceTree = "<group>"; };
+               33D3A3C0133960B000709BE4 /* WebMediaCacheManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebMediaCacheManager.messages.in; path = MediaCache/WebMediaCacheManager.messages.in; sourceTree = "<group>"; };
+               33D3A3C41339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaCacheManagerMessageReceiver.cpp; sourceTree = "<group>"; };
+               33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerMessages.h; sourceTree = "<group>"; };
+               33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaCacheManagerProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+               33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerProxyMessages.h; sourceTree = "<group>"; };
                33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = WebResourceCacheManagerCFNet.cpp; path = ResourceCache/cf/WebResourceCacheManagerCFNet.cpp; sourceTree = "<group>"; };
                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>"; };
                        name = ResourceCache;
                        sourceTree = "<group>";
                };
+               33D3A3BD1339609800709BE4 /* MediaCache */ = {
+                       isa = PBXGroup;
+                       children = (
+                               33D3A3BE133960B000709BE4 /* WebMediaCacheManager.cpp */,
+                               33D3A3BF133960B000709BE4 /* WebMediaCacheManager.h */,
+                               33D3A3C0133960B000709BE4 /* WebMediaCacheManager.messages.in */,
+                       );
+                       name = MediaCache;
+                       sourceTree = "<group>";
+               };
                33F9D5B71312F1B1000D683F /* cf */ = {
                        isa = PBXGroup;
                        children = (
                                BC204EDF11C83E72008F3375 /* InjectedBundle */,
                                51A9E0FB1315CC0E009E7031 /* KeyValueStorage */,
                                1A6FA01C11E1526300DB1371 /* mac */,
+                               33D3A3BD1339609800709BE4 /* MediaCache */,
                                1A6FB7AA11E64B4900DB1371 /* Plugins */,
                                3336762B130C9978006C9DE2 /* ResourceCache */,
                                BC032D5D10F437220058C15A /* WebCoreSupport */,
                                51A9E1041315CCFC009E7031 /* WebKeyValueStorageManagerProxy.messages.in */,
                                BCB9E76111232B9E00A137E0 /* WebLoaderClient.cpp */,
                                BC59534010FC04520098F82D /* WebLoaderClient.h */,
+                               33D3A3B71339606200709BE4 /* WebMediaCacheManagerProxy.cpp */,
+                               33D3A3B81339606200709BE4 /* WebMediaCacheManagerProxy.h */,
+                               33D3A3B91339606200709BE4 /* WebMediaCacheManagerProxy.messages.in */,
                                BCF69FA11176D01400471A52 /* WebNavigationData.cpp */,
                                BCF69FA01176D01400471A52 /* WebNavigationData.h */,
                                BC1DFEA312B31F87005DF730 /* WebOpenPanelResultListenerProxy.cpp */,
                                1C8E293712761E5B00BC7BD0 /* WKInspector.h */,
                                51A9E1081315CD18009E7031 /* WKKeyValueStorageManager.cpp */,
                                51A9E1091315CD18009E7031 /* WKKeyValueStorageManager.h */,
+                               33D3A3B31339600B00709BE4 /* WKMediaCacheManager.cpp */,
+                               33D3A3B41339600B00709BE4 /* WKMediaCacheManager.h */,
                                C09AE5E8125257C20025825D /* WKNativeEvent.h */,
                                BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */,
                                BCF69FA71176D1CB00471A52 /* WKNavigationData.h */,
                                51A9E1251315ED35009E7031 /* WebKeyValueStorageManagerMessages.h */,
                                51A9E1261315ED35009E7031 /* WebKeyValueStorageManagerProxyMessageReceiver.cpp */,
                                51A9E1271315ED35009E7031 /* WebKeyValueStorageManagerProxyMessages.h */,
+                               33D3A3C41339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp */,
+                               33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */,
+                               33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */,
+                               33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */,
                                C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */,
                                C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */,
                                BCBD3912125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp */,
                                511B24AB132E097200065A0C /* WebIconDatabase.h in Headers */,
                                51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */,
                                51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */,
+                               33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */,
+                               33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */,
+                               33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */,
+                               33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */,
+                               33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                511B24AA132E097200065A0C /* WebIconDatabase.cpp in Sources */,
                                51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */,
                                51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */,
+                               33D3A3B51339600B00709BE4 /* WKMediaCacheManager.cpp in Sources */,
+                               33D3A3BA1339606200709BE4 /* WebMediaCacheManagerProxy.cpp in Sources */,
+                               33D3A3C1133960B000709BE4 /* WebMediaCacheManager.cpp in Sources */,
+                               33D3A3C81339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp in Sources */,
+                               33D3A3CA1339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp in Sources */,
                                5160BFE113381DF900918999 /* Logging.mac.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp
new file mode 100644 (file)
index 0000000..471ac2e
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * 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 "WebMediaCacheManager.h"
+
+#include "MessageID.h"
+#include "SecurityOriginData.h"
+#include "WebMediaCacheManagerProxyMessages.h"
+#include "WebProcess.h"
+#include <WebCore/NotImplemented.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebMediaCacheManager& WebMediaCacheManager::shared()
+{
+    static WebMediaCacheManager& shared = *new WebMediaCacheManager;
+    return shared;
+}
+
+WebMediaCacheManager::WebMediaCacheManager()
+{
+}
+
+void WebMediaCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebMediaCacheManagerMessage(connection, messageID, arguments);
+}
+
+void WebMediaCacheManager::getHostnamesWithMediaCache(uint64_t callbackID)
+{
+    Vector<String> mediaCacheHostnames;
+
+    // FIXME: Popuplate the list of hosts that have entries in the media cache.
+    notImplemented();
+
+    WebProcess::shared().connection()->send(Messages::WebMediaCacheManagerProxy::DidGetHostnamesWithMediaCache(mediaCacheHostnames, callbackID), 0);
+}
+
+void WebMediaCacheManager::clearCacheForHostname(const String& hostname)
+{
+    // FIXME: Delete the media cache entries for this hostname.
+    notImplemented();
+}
+
+void WebMediaCacheManager::clearCacheForAllHostnames()
+{
+    // FIXME: Delete all media cache entries.
+    notImplemented();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h
new file mode 100644 (file)
index 0000000..909be97
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * 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 WebMediaCacheManager_h
+#define WebMediaCacheManager_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/text/WTFString.h>
+
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class Connection;
+    class MessageID;
+}
+
+namespace WebKit {
+
+class WebMediaCacheManager {
+    WTF_MAKE_NONCOPYABLE(WebMediaCacheManager);
+
+public:
+    static WebMediaCacheManager& shared();
+
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+private:
+    WebMediaCacheManager();
+    
+    void getHostnamesWithMediaCache(uint64_t callbackID);
+    void clearCacheForHostname(const String&);
+    void clearCacheForAllHostnames();
+
+    void didReceiveWebMediaCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+};
+
+} // namespace WebKit
+
+#endif // WebMediaCacheManager_h
diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.messages.in b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.messages.in
new file mode 100644 (file)
index 0000000..5eee8cc
--- /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 -> WebMediaCacheManager {
+    void GetHostnamesWithMediaCache(uint64_t callbackID)
+    void ClearCacheForHostname(WTF::String hostname)
+    void ClearCacheForAllHostnames()
+}
index 5d125a6..ba3290b 100644 (file)
@@ -41,6 +41,7 @@
 #include "WebFrame.h"
 #include "WebGeolocationManagerMessages.h"
 #include "WebKeyValueStorageManager.h"
+#include "WebMediaCacheManager.h"
 #include "WebMemorySampler.h"
 #include "WebPage.h"
 #include "WebPageCreationParameters.h"
@@ -598,6 +599,11 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassWebMediaCacheManager>()) {
+        WebMediaCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+
     if (messageID.is<CoreIPC::MessageClassWebResourceCacheManager>()) {
         WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
         return;
index 14de2f9..a8e559b 100755 (executable)
                                </File>
                        </Filter>
                        <Filter
+                               Name="MediaCache"
+                               >
+                               <File
+                                       RelativePath="..\WebProcess\MediaCache\WebMediaCacheManager.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\WebProcess\MediaCache\WebMediaCacheManager.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\WebProcess\MediaCache\WebMediaCacheManager.messages.in"
+                                       >
+                               </File>
+                       </Filter>
+                       <Filter
                                Name="ResourceCache"
                                >
                                <File
                                >
                        </File>
                        <File
+                               RelativePath="..\UIProcess\WebMediaCacheManagerProxy.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\UIProcess\WebMediaCacheManagerProxy.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\UIProcess\WebMediaCacheManagerProxy.messages.in"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\UIProcess\WebNavigationData.cpp"
                                >
                        </File>
                                                >
                                        </File>
                                        <File
+                                               RelativePath="..\UIProcess\API\C\WKMediaCacheManager.cpp"
+                                               >
+                                       </File>
+                                       <File
+                                               RelativePath="..\UIProcess\API\C\WKMediaCacheManager.h"
+                                               >
+                                       </File>
+                                       <File
                                                RelativePath="..\UIProcess\API\C\WKNativeEvent.h"
                                                >
                                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerMessages.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerProxyMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerProxyMessages.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebPageMessageReceiver.cpp"
                                >
                        </File>
index 2a32628..e20e2cd 100755 (executable)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&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\IconDatabase&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\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&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;"
+               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&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\IconDatabase&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\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\MediaCache&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 e919c54..b528a03 100644 (file)
@@ -58,6 +58,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\WKGeolocationPosition.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKInspector.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKKeyValueStorageManager.h" "%ConfigurationBuildDir%\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\WKMediaCacheManager.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKNativeEvent.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKNavigationData.h" "%ConfigurationBuildDir%\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKOpenPanelParameters.h" "%ConfigurationBuildDir%\include\WebKit2"