Bug 1034315: Don't use NS_DECL_NSIFOO macros without inheriting from nsIFoo in netwerk/. r=mayhemer
authorKyle Huey <khuey@kylehuey.com>
Thu, 21 Aug 2014 10:47:38 -0700
changeset 200924 7c6307643e903f2a04888431fa59e64da4a3104a
parent 200923 1903ba337cdd13dbaccf8d6d33282f32f5762e6f
child 200925 01373cfb25f9df4e8596eaeac3d90f17e68b137d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmayhemer
bugs1034315
milestone34.0a1
Bug 1034315: Don't use NS_DECL_NSIFOO macros without inheriting from nsIFoo in netwerk/. r=mayhemer
netwerk/cache2/OldWrappers.h
--- a/netwerk/cache2/OldWrappers.h
+++ b/netwerk/cache2/OldWrappers.h
@@ -23,18 +23,170 @@ class nsILoadContextInfo;
 namespace mozilla { namespace net {
 
 class CacheStorage;
 
 class _OldCacheEntryWrapper : public nsICacheEntry
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
-  NS_FORWARD_SAFE_NSICACHEENTRYDESCRIPTOR(mOldDesc)
-  NS_FORWARD_NSICACHEENTRYINFO(mOldInfo->)
+
+  // nsICacheEntryDescriptor
+  NS_IMETHOD SetExpirationTime(uint32_t expirationTime)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetExpirationTime(expirationTime);
+  }
+  NS_IMETHOD SetDataSize(uint32_t size)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetDataSize(size);
+  }
+  NS_IMETHOD OpenInputStream(uint32_t offset, nsIInputStream * *_retval)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->OpenInputStream(offset, _retval);
+  }
+  NS_IMETHOD OpenOutputStream(uint32_t offset, nsIOutputStream * *_retval)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->OpenOutputStream(offset, _retval);
+  }
+  NS_IMETHOD GetCacheElement(nsISupports * *aCacheElement)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetCacheElement(aCacheElement);
+  }
+  NS_IMETHOD SetCacheElement(nsISupports *aCacheElement)
+  { return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetCacheElement(aCacheElement);
+  }
+  NS_IMETHOD GetPredictedDataSize(int64_t *aPredictedDataSize)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetPredictedDataSize(aPredictedDataSize);
+  }
+  NS_IMETHOD SetPredictedDataSize(int64_t aPredictedDataSize)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetPredictedDataSize(aPredictedDataSize);
+  }
+  NS_IMETHOD GetAccessGranted(nsCacheAccessMode *aAccessGranted)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetAccessGranted(aAccessGranted);
+  }
+  NS_IMETHOD GetStoragePolicy(nsCacheStoragePolicy *aStoragePolicy)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetStoragePolicy(aStoragePolicy);
+  }
+  NS_IMETHOD SetStoragePolicy(nsCacheStoragePolicy aStoragePolicy)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetStoragePolicy(aStoragePolicy);
+  }
+  NS_IMETHOD GetFile(nsIFile * *aFile)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetFile(aFile);
+  }
+  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetSecurityInfo(aSecurityInfo);
+  }
+  NS_IMETHOD SetSecurityInfo(nsISupports *aSecurityInfo)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetSecurityInfo(aSecurityInfo);
+  }
+  NS_IMETHOD GetStorageDataSize(uint32_t *aStorageDataSize)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetStorageDataSize(aStorageDataSize);
+  }
+  NS_IMETHOD Doom(void)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->Doom();
+  }
+  NS_IMETHOD DoomAndFailPendingRequests(nsresult status)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->DoomAndFailPendingRequests(status);
+  }
+  NS_IMETHOD AsyncDoom(nsICacheListener *listener)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->AsyncDoom(listener);
+  }
+  NS_IMETHOD MarkValid(void)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->MarkValid();
+  }
+  NS_IMETHOD Close(void)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->Close();
+  }
+  NS_IMETHOD GetMetaDataElement(const char * key, char * *_retval)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->GetMetaDataElement(key, _retval);
+  }
+  NS_IMETHOD SetMetaDataElement(const char * key, const char * value)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->SetMetaDataElement(key, value);
+  }
+  NS_IMETHOD VisitMetaData(nsICacheMetaDataVisitor *visitor)
+  {
+    return !mOldDesc ? NS_ERROR_NULL_POINTER :
+                       mOldDesc->VisitMetaData(visitor);
+  }
+
+  // nsICacheEntryInfo
+  NS_IMETHOD GetClientID(char * *aClientID)
+  {
+    return mOldInfo->GetClientID(aClientID);
+  }
+  NS_IMETHOD GetDeviceID(char * *aDeviceID)
+  {
+    return mOldInfo->GetDeviceID(aDeviceID);
+  }
+  NS_IMETHOD GetKey(nsACString & aKey)
+  {
+    return mOldInfo->GetKey(aKey);
+  }
+  NS_IMETHOD GetFetchCount(int32_t *aFetchCount)
+  {
+    return mOldInfo->GetFetchCount(aFetchCount);
+  }
+  NS_IMETHOD GetLastFetched(uint32_t *aLastFetched)
+  {
+    return mOldInfo->GetLastFetched(aLastFetched);
+  }
+  NS_IMETHOD GetLastModified(uint32_t *aLastModified)
+  {
+    return mOldInfo->GetLastModified(aLastModified);
+  }
+  NS_IMETHOD GetExpirationTime(uint32_t *aExpirationTime)
+  {
+    return mOldInfo->GetExpirationTime(aExpirationTime);
+  }
+  NS_IMETHOD GetDataSize(uint32_t *aDataSize)
+  {
+    return mOldInfo->GetDataSize(aDataSize);
+  }
+  NS_IMETHOD IsStreamBased(bool *_retval)
+  {
+    return mOldInfo->IsStreamBased(_retval);
+  }
 
   NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback* listener);
   NS_IMETHOD GetPersistent(bool *aPersistToDisk);
   NS_IMETHOD GetIsForcedValid(bool *aIsForcedValid);
   NS_IMETHOD ForceValidFor(uint32_t aSecondsToTheFuture);
   NS_IMETHOD SetValid() { return NS_OK; }
   NS_IMETHOD MetaDataReady() { return NS_OK; }
   NS_IMETHOD Recreate(bool, nsICacheEntry**);