Jacek Caban : mshtml: Add nsICacheInfoChannel stub implementation.

Alexandre Julliard julliard at winehq.org
Wed Feb 17 16:23:34 CST 2021


Module: wine
Branch: master
Commit: edbddef57ecdd0dab5d691f9a202749375823725
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=edbddef57ecdd0dab5d691f9a202749375823725

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Feb 17 14:31:17 2021 +0100

mshtml: Add nsICacheInfoChannel stub implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/binding.h   |  1 +
 dlls/mshtml/nsiface.idl | 17 +++++++++
 dlls/mshtml/nsio.c      | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 116 insertions(+)

diff --git a/dlls/mshtml/binding.h b/dlls/mshtml/binding.h
index 9926fa0dc33..3d1ea6ecc8d 100644
--- a/dlls/mshtml/binding.h
+++ b/dlls/mshtml/binding.h
@@ -35,6 +35,7 @@ typedef struct {
     nsIHttpChannel         nsIHttpChannel_iface;
     nsIUploadChannel       nsIUploadChannel_iface;
     nsIHttpChannelInternal nsIHttpChannelInternal_iface;
+    nsICacheInfoChannel    nsICacheInfoChannel_iface;
 
     LONG ref;
 
diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl
index a621007b0cc..2ecd8d93854 100644
--- a/dlls/mshtml/nsiface.idl
+++ b/dlls/mshtml/nsiface.idl
@@ -728,6 +728,23 @@ interface nsIFormPOSTActionChannel : nsIUploadChannel
 {
 }
 
+[
+    object,
+    uuid(72c34415-c6eb-48af-851f-772fa9ee5972),
+    local
+]
+interface nsICacheInfoChannel : nsISupports
+{
+    nsresult GetCacheTokenExpirationTime(uint32_t *aCacheTokenExpirationTime);
+    nsresult GetCacheTokenCachedCharset(nsACString *aCacheTokenCachedCharset);
+    nsresult SetCacheTokenCachedCharset(const nsACString *aCacheTokenCachedCharset);
+    nsresult IsFromCache(bool *_retval);
+    nsresult GetCacheKey(nsISupports **aCacheKey);
+    nsresult SetCacheKey(nsISupports *aCacheKey);
+    nsresult GetAllowStaleCacheContent(bool *aAllowStaleCacheContent);
+    nsresult SetAllowStaleCacheContent(bool aAllowStaleCacheContent);
+}
+
 [
     object,
     uuid(8d171460-a716-41f1-92be-8c659db39b45),
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index ee709645873..9ba5a6c8612 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -521,6 +521,9 @@ static nsresult NSAPI nsChannel_QueryInterface(nsIHttpChannel *iface, nsIIDRef r
     }else if(IsEqualGUID(&IID_nsIHttpChannelInternal, riid)) {
         TRACE("(%p)->(IID_nsIHttpChannelInternal %p)\n", This, result);
         *result = is_http_channel(This) ? &This->nsIHttpChannelInternal_iface : NULL;
+    }else if(IsEqualGUID(&IID_nsICacheInfoChannel, riid)) {
+        TRACE("(%p)->(IID_nsICacheInfoChannel %p)\n", This, result);
+        *result = is_http_channel(This) ? &This->nsICacheInfoChannel_iface : NULL;
     }else {
         TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
         *result = NULL;
@@ -2138,6 +2141,100 @@ static const nsIHttpChannelInternalVtbl nsHttpChannelInternalVtbl = {
     nsHttpChannelInternal_SetBlockAuthPrompt
 };
 
+static inline nsChannel *impl_from_nsICacheInfoChannel(nsICacheInfoChannel *iface)
+{
+    return CONTAINING_RECORD(iface, nsChannel, nsICacheInfoChannel_iface);
+}
+
+static nsresult NSAPI nsCacheInfoChannel_QueryInterface(nsICacheInfoChannel *iface, nsIIDRef riid,
+        void **result)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    return nsIHttpChannel_QueryInterface(&This->nsIHttpChannel_iface, riid, result);
+}
+
+static nsrefcnt NSAPI nsCacheInfoChannel_AddRef(nsICacheInfoChannel *iface)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    return nsIHttpChannel_AddRef(&This->nsIHttpChannel_iface);
+}
+
+static nsrefcnt NSAPI nsCacheInfoChannel_Release(nsICacheInfoChannel *iface)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    return nsIHttpChannel_Release(&This->nsIHttpChannel_iface);
+}
+
+static nsresult NSAPI nsCacheInfoChannel_GetCacheTokenExpirationTime(nsICacheInfoChannel *iface, UINT32 *p)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_GetCacheTokenCachedCharset(nsICacheInfoChannel *iface, nsACString *p)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_SetCacheTokenCachedCharset(nsICacheInfoChannel *iface, const nsACString *p)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, debugstr_nsacstr(p));
+    return E_NOTIMPL;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_IsFromCache(nsICacheInfoChannel *iface, cpp_bool *p)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    *p = FALSE;
+    return NS_OK;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_GetCacheKey(nsICacheInfoChannel *iface, nsISupports **p)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_SetCacheKey(nsICacheInfoChannel *iface, nsISupports *key)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, key);
+    return E_NOTIMPL;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_GetAllowStaleCacheContent(nsICacheInfoChannel *iface, cpp_bool *p)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static nsresult NSAPI nsCacheInfoChannel_SetAllowStaleCacheContent(nsICacheInfoChannel *iface, cpp_bool allow)
+{
+    nsChannel *This = impl_from_nsICacheInfoChannel(iface);
+    FIXME("(%p)->(%x)\n", This, allow);
+    return E_NOTIMPL;
+}
+
+static const nsICacheInfoChannelVtbl nsCacheInfoChannelVtbl = {
+    nsCacheInfoChannel_QueryInterface,
+    nsCacheInfoChannel_AddRef,
+    nsCacheInfoChannel_Release,
+    nsCacheInfoChannel_GetCacheTokenExpirationTime,
+    nsCacheInfoChannel_GetCacheTokenCachedCharset,
+    nsCacheInfoChannel_SetCacheTokenCachedCharset,
+    nsCacheInfoChannel_IsFromCache,
+    nsCacheInfoChannel_GetCacheKey,
+    nsCacheInfoChannel_SetCacheKey,
+    nsCacheInfoChannel_GetAllowStaleCacheContent,
+    nsCacheInfoChannel_SetAllowStaleCacheContent
+};
 
 static void invalidate_uri(nsWineURI *This)
 {
@@ -3382,6 +3479,7 @@ static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret)
     channel->nsIHttpChannel_iface.lpVtbl = &nsChannelVtbl;
     channel->nsIUploadChannel_iface.lpVtbl = &nsUploadChannelVtbl;
     channel->nsIHttpChannelInternal_iface.lpVtbl = &nsHttpChannelInternalVtbl;
+    channel->nsICacheInfoChannel_iface.lpVtbl = &nsCacheInfoChannelVtbl;
     channel->ref = 1;
     channel->request_method = METHOD_GET;
     list_init(&channel->response_headers);




More information about the wine-cvs mailing list