Bug 615425 warnings in prefetch
authortimeless@mozdev.org
Sat, 04 Dec 2010 11:07:08 +0100
changeset 58606 f93c3727b04357bfb0cdb416478b336e832ff02b
parent 58605 ba11bdfe7034d16cdf3e8097694ee30b1578bbd1
child 58607 5c000f879f4c3c4887053a00ed498089861ea890
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
bugs615425
milestone2.0b8pre
Bug 615425 warnings in prefetch r=jst
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -71,18 +71,16 @@
 #include "nsProxyRelease.h"
 #include "prlog.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 
 #ifdef MOZ_IPC
 #include "nsXULAppAPI.h"
 #endif
 
-static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nsnull;
-
 static const PRUint32 kRescheduleLimit = 3;
 
 #if defined(PR_LOGGING)
 //
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
@@ -1497,17 +1495,17 @@ nsOfflineCacheUpdate::ManifestCheckCompl
             new nsOfflineCacheUpdate();
         // Leave aDocument argument null. Only glues and children keep 
         // document instances.
         newUpdate->Init(mManifestURI, mDocumentURI, nsnull);
 
         // In a rare case the manifest will not be modified on the next refetch
         // transfer all master document URIs to the new update to ensure that
         // all documents refering it will be properly cached.
-        for (PRUint32 i = 0; i < mDocumentURIs.Count(); i++) {
+        for (PRInt32 i = 0; i < mDocumentURIs.Count(); i++) {
             newUpdate->StickDocument(mDocumentURIs[i]);
         }
 
         newUpdate->mRescheduleCount = mRescheduleCount + 1;
         newUpdate->AddObserver(this, PR_FALSE);
         newUpdate->Schedule();
     }
     else {
@@ -1767,17 +1765,17 @@ nsOfflineCacheUpdate::ScheduleImplicit()
     }
     else {
         clientID = mClientID;
     }
 
     rv = update->InitPartial(mManifestURI, clientID, mDocumentURI);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    for (PRUint32 i = 0; i < mDocumentURIs.Count(); i++) {
+    for (PRInt32 i = 0; i < mDocumentURIs.Count(); i++) {
         rv = update->AddURI(mDocumentURIs[i], 
               nsIApplicationCache::ITEM_IMPLICIT);
         NS_ENSURE_SUCCESS(rv, rv);
     }
 
     update->SetOwner(this);
     rv = update->Begin();
     NS_ENSURE_SUCCESS(rv, rv);
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -105,28 +105,16 @@ public:
     AutoFreeArray(PRUint32 count, char **values)
         : mCount(count), mValues(values) {};
     ~AutoFreeArray() { NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mValues); }
 private:
     PRUint32 mCount;
     char **mValues;
 };
 
-static nsresult
-DropReferenceFromURL(nsIURI * aURI)
-{
-    nsCOMPtr<nsIURL> url = do_QueryInterface(aURI);
-    if (url) {
-        nsresult rv = url->SetRef(EmptyCString());
-        NS_ENSURE_SUCCESS(rv, rv);
-    }
-
-    return NS_OK;
-}
-
 //-----------------------------------------------------------------------------
 // nsOfflineCachePendingUpdate
 //-----------------------------------------------------------------------------
 
 class nsOfflineCachePendingUpdate : public nsIWebProgressListener
                                   , public nsSupportsWeakReference
 {
 public: